1#![doc = "MAVLink AVSSUAS dialect."]
2#![doc = ""]
3#![doc = "This file was automatically generated, do not edit."]
4#![allow(deprecated)]
5#[cfg(feature = "arbitrary")]
6use arbitrary::Arbitrary;
7#[allow(unused_imports)]
8use bitflags::bitflags;
9use mavlink_core::{bytes::Bytes, bytes_mut::BytesMut, MavlinkVersion, Message, MessageData};
10#[allow(unused_imports)]
11use num_derive::FromPrimitive;
12#[allow(unused_imports)]
13use num_derive::ToPrimitive;
14#[allow(unused_imports)]
15use num_traits::FromPrimitive;
16#[allow(unused_imports)]
17use num_traits::ToPrimitive;
18#[cfg(feature = "serde")]
19use serde::{Deserialize, Serialize};
20#[cfg(feature = "ts")]
21use ts_rs::TS;
22pub const MINOR_MAVLINK_VERSION: u8 = 2u8;
23pub const DIALECT_NUMBER: u8 = 1u8;
24#[cfg_attr(feature = "ts", derive(TS))]
25#[cfg_attr(feature = "ts", ts(export))]
26#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
27#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28#[cfg_attr(feature = "serde", serde(tag = "type"))]
29#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30#[repr(u32)]
31#[doc = "Actuator configuration, used to change a setting on an actuator. Component information metadata can be used to know which outputs support which commands."]
32pub enum ActuatorConfiguration {
33 #[doc = "Do nothing."]
34 ACTUATOR_CONFIGURATION_NONE = 0,
35 #[doc = "Command the actuator to beep now."]
36 ACTUATOR_CONFIGURATION_BEEP = 1,
37 #[doc = "Permanently set the actuator (ESC) to 3D mode (reversible thrust)."]
38 ACTUATOR_CONFIGURATION_3D_MODE_ON = 2,
39 #[doc = "Permanently set the actuator (ESC) to non 3D mode (non-reversible thrust)."]
40 ACTUATOR_CONFIGURATION_3D_MODE_OFF = 3,
41 #[doc = "Permanently set the actuator (ESC) to spin direction 1 (which can be clockwise or counter-clockwise)."]
42 ACTUATOR_CONFIGURATION_SPIN_DIRECTION1 = 4,
43 #[doc = "Permanently set the actuator (ESC) to spin direction 2 (opposite of direction 1)."]
44 ACTUATOR_CONFIGURATION_SPIN_DIRECTION2 = 5,
45}
46impl ActuatorConfiguration {
47 pub const DEFAULT: Self = Self::ACTUATOR_CONFIGURATION_NONE;
48}
49impl Default for ActuatorConfiguration {
50 fn default() -> Self {
51 Self::DEFAULT
52 }
53}
54#[cfg_attr(feature = "ts", derive(TS))]
55#[cfg_attr(feature = "ts", ts(export))]
56#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
57#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
58#[cfg_attr(feature = "serde", serde(tag = "type"))]
59#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
60#[repr(u32)]
61#[doc = "Actuator output function. Values greater or equal to 1000 are autopilot-specific."]
62pub enum ActuatorOutputFunction {
63 #[doc = "No function (disabled)."]
64 ACTUATOR_OUTPUT_FUNCTION_NONE = 0,
65 #[doc = "Motor 1"]
66 ACTUATOR_OUTPUT_FUNCTION_MOTOR1 = 1,
67 #[doc = "Motor 2"]
68 ACTUATOR_OUTPUT_FUNCTION_MOTOR2 = 2,
69 #[doc = "Motor 3"]
70 ACTUATOR_OUTPUT_FUNCTION_MOTOR3 = 3,
71 #[doc = "Motor 4"]
72 ACTUATOR_OUTPUT_FUNCTION_MOTOR4 = 4,
73 #[doc = "Motor 5"]
74 ACTUATOR_OUTPUT_FUNCTION_MOTOR5 = 5,
75 #[doc = "Motor 6"]
76 ACTUATOR_OUTPUT_FUNCTION_MOTOR6 = 6,
77 #[doc = "Motor 7"]
78 ACTUATOR_OUTPUT_FUNCTION_MOTOR7 = 7,
79 #[doc = "Motor 8"]
80 ACTUATOR_OUTPUT_FUNCTION_MOTOR8 = 8,
81 #[doc = "Motor 9"]
82 ACTUATOR_OUTPUT_FUNCTION_MOTOR9 = 9,
83 #[doc = "Motor 10"]
84 ACTUATOR_OUTPUT_FUNCTION_MOTOR10 = 10,
85 #[doc = "Motor 11"]
86 ACTUATOR_OUTPUT_FUNCTION_MOTOR11 = 11,
87 #[doc = "Motor 12"]
88 ACTUATOR_OUTPUT_FUNCTION_MOTOR12 = 12,
89 #[doc = "Motor 13"]
90 ACTUATOR_OUTPUT_FUNCTION_MOTOR13 = 13,
91 #[doc = "Motor 14"]
92 ACTUATOR_OUTPUT_FUNCTION_MOTOR14 = 14,
93 #[doc = "Motor 15"]
94 ACTUATOR_OUTPUT_FUNCTION_MOTOR15 = 15,
95 #[doc = "Motor 16"]
96 ACTUATOR_OUTPUT_FUNCTION_MOTOR16 = 16,
97 #[doc = "Servo 1"]
98 ACTUATOR_OUTPUT_FUNCTION_SERVO1 = 33,
99 #[doc = "Servo 2"]
100 ACTUATOR_OUTPUT_FUNCTION_SERVO2 = 34,
101 #[doc = "Servo 3"]
102 ACTUATOR_OUTPUT_FUNCTION_SERVO3 = 35,
103 #[doc = "Servo 4"]
104 ACTUATOR_OUTPUT_FUNCTION_SERVO4 = 36,
105 #[doc = "Servo 5"]
106 ACTUATOR_OUTPUT_FUNCTION_SERVO5 = 37,
107 #[doc = "Servo 6"]
108 ACTUATOR_OUTPUT_FUNCTION_SERVO6 = 38,
109 #[doc = "Servo 7"]
110 ACTUATOR_OUTPUT_FUNCTION_SERVO7 = 39,
111 #[doc = "Servo 8"]
112 ACTUATOR_OUTPUT_FUNCTION_SERVO8 = 40,
113 #[doc = "Servo 9"]
114 ACTUATOR_OUTPUT_FUNCTION_SERVO9 = 41,
115 #[doc = "Servo 10"]
116 ACTUATOR_OUTPUT_FUNCTION_SERVO10 = 42,
117 #[doc = "Servo 11"]
118 ACTUATOR_OUTPUT_FUNCTION_SERVO11 = 43,
119 #[doc = "Servo 12"]
120 ACTUATOR_OUTPUT_FUNCTION_SERVO12 = 44,
121 #[doc = "Servo 13"]
122 ACTUATOR_OUTPUT_FUNCTION_SERVO13 = 45,
123 #[doc = "Servo 14"]
124 ACTUATOR_OUTPUT_FUNCTION_SERVO14 = 46,
125 #[doc = "Servo 15"]
126 ACTUATOR_OUTPUT_FUNCTION_SERVO15 = 47,
127 #[doc = "Servo 16"]
128 ACTUATOR_OUTPUT_FUNCTION_SERVO16 = 48,
129}
130impl ActuatorOutputFunction {
131 pub const DEFAULT: Self = Self::ACTUATOR_OUTPUT_FUNCTION_NONE;
132}
133impl Default for ActuatorOutputFunction {
134 fn default() -> Self {
135 Self::DEFAULT
136 }
137}
138#[cfg_attr(feature = "ts", derive(TS))]
139#[cfg_attr(feature = "ts", ts(export))]
140#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
141#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
142#[cfg_attr(feature = "serde", serde(tag = "type"))]
143#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
144#[repr(u32)]
145#[doc = "Enumeration of the ADSB altimeter types"]
146pub enum AdsbAltitudeType {
147 #[doc = "Altitude reported from a Baro source using QNH reference"]
148 ADSB_ALTITUDE_TYPE_PRESSURE_QNH = 0,
149 #[doc = "Altitude reported from a GNSS source"]
150 ADSB_ALTITUDE_TYPE_GEOMETRIC = 1,
151}
152impl AdsbAltitudeType {
153 pub const DEFAULT: Self = Self::ADSB_ALTITUDE_TYPE_PRESSURE_QNH;
154}
155impl Default for AdsbAltitudeType {
156 fn default() -> Self {
157 Self::DEFAULT
158 }
159}
160#[cfg_attr(feature = "ts", derive(TS))]
161#[cfg_attr(feature = "ts", ts(export))]
162#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
163#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
164#[cfg_attr(feature = "serde", serde(tag = "type"))]
165#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
166#[repr(u32)]
167#[doc = "ADSB classification for the type of vehicle emitting the transponder signal"]
168pub enum AdsbEmitterType {
169 ADSB_EMITTER_TYPE_NO_INFO = 0,
170 ADSB_EMITTER_TYPE_LIGHT = 1,
171 ADSB_EMITTER_TYPE_SMALL = 2,
172 ADSB_EMITTER_TYPE_LARGE = 3,
173 ADSB_EMITTER_TYPE_HIGH_VORTEX_LARGE = 4,
174 ADSB_EMITTER_TYPE_HEAVY = 5,
175 ADSB_EMITTER_TYPE_HIGHLY_MANUV = 6,
176 ADSB_EMITTER_TYPE_ROTOCRAFT = 7,
177 ADSB_EMITTER_TYPE_UNASSIGNED = 8,
178 ADSB_EMITTER_TYPE_GLIDER = 9,
179 ADSB_EMITTER_TYPE_LIGHTER_AIR = 10,
180 ADSB_EMITTER_TYPE_PARACHUTE = 11,
181 ADSB_EMITTER_TYPE_ULTRA_LIGHT = 12,
182 ADSB_EMITTER_TYPE_UNASSIGNED2 = 13,
183 ADSB_EMITTER_TYPE_UAV = 14,
184 ADSB_EMITTER_TYPE_SPACE = 15,
185 ADSB_EMITTER_TYPE_UNASSGINED3 = 16,
186 ADSB_EMITTER_TYPE_EMERGENCY_SURFACE = 17,
187 ADSB_EMITTER_TYPE_SERVICE_SURFACE = 18,
188 ADSB_EMITTER_TYPE_POINT_OBSTACLE = 19,
189}
190impl AdsbEmitterType {
191 pub const DEFAULT: Self = Self::ADSB_EMITTER_TYPE_NO_INFO;
192}
193impl Default for AdsbEmitterType {
194 fn default() -> Self {
195 Self::DEFAULT
196 }
197}
198bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags indicate status such as data validity of each data source. Set = data valid"] pub struct AdsbFlags : u16 { const ADSB_FLAGS_VALID_COORDS = 1 ; const ADSB_FLAGS_VALID_ALTITUDE = 2 ; const ADSB_FLAGS_VALID_HEADING = 4 ; const ADSB_FLAGS_VALID_VELOCITY = 8 ; const ADSB_FLAGS_VALID_CALLSIGN = 16 ; const ADSB_FLAGS_VALID_SQUAWK = 32 ; const ADSB_FLAGS_SIMULATED = 64 ; const ADSB_FLAGS_VERTICAL_VELOCITY_VALID = 128 ; const ADSB_FLAGS_BARO_VALID = 256 ; const ADSB_FLAGS_SOURCE_UAT = 32768 ; } }
199impl AdsbFlags {
200 pub const DEFAULT: Self = Self::ADSB_FLAGS_VALID_COORDS;
201}
202impl Default for AdsbFlags {
203 fn default() -> Self {
204 Self::DEFAULT
205 }
206}
207bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags are used in the AIS_VESSEL.fields bitmask to indicate validity of data in the other message fields. When set, the data is valid."] pub struct AisFlags : u16 { # [doc = "1 = Position accuracy less than 10m, 0 = position accuracy greater than 10m."] const AIS_FLAGS_POSITION_ACCURACY = 1 ; const AIS_FLAGS_VALID_COG = 2 ; const AIS_FLAGS_VALID_VELOCITY = 4 ; # [doc = "1 = Velocity over 52.5765m/s (102.2 knots)"] const AIS_FLAGS_HIGH_VELOCITY = 8 ; const AIS_FLAGS_VALID_TURN_RATE = 16 ; # [doc = "Only the sign of the returned turn rate value is valid, either greater than 5deg/30s or less than -5deg/30s"] const AIS_FLAGS_TURN_RATE_SIGN_ONLY = 32 ; const AIS_FLAGS_VALID_DIMENSIONS = 64 ; # [doc = "Distance to bow is larger than 511m"] const AIS_FLAGS_LARGE_BOW_DIMENSION = 128 ; # [doc = "Distance to stern is larger than 511m"] const AIS_FLAGS_LARGE_STERN_DIMENSION = 256 ; # [doc = "Distance to port side is larger than 63m"] const AIS_FLAGS_LARGE_PORT_DIMENSION = 512 ; # [doc = "Distance to starboard side is larger than 63m"] const AIS_FLAGS_LARGE_STARBOARD_DIMENSION = 1024 ; const AIS_FLAGS_VALID_CALLSIGN = 2048 ; const AIS_FLAGS_VALID_NAME = 4096 ; } }
208impl AisFlags {
209 pub const DEFAULT: Self = Self::AIS_FLAGS_POSITION_ACCURACY;
210}
211impl Default for AisFlags {
212 fn default() -> Self {
213 Self::DEFAULT
214 }
215}
216#[cfg_attr(feature = "ts", derive(TS))]
217#[cfg_attr(feature = "ts", ts(export))]
218#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
219#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
220#[cfg_attr(feature = "serde", serde(tag = "type"))]
221#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
222#[repr(u32)]
223#[doc = "Navigational status of AIS vessel, enum duplicated from AIS standard, <https://gpsd.gitlab.io/gpsd/AIVDM.html>"]
224pub enum AisNavStatus {
225 #[doc = "Under way using engine."]
226 UNDER_WAY = 0,
227 AIS_NAV_ANCHORED = 1,
228 AIS_NAV_UN_COMMANDED = 2,
229 AIS_NAV_RESTRICTED_MANOEUVERABILITY = 3,
230 AIS_NAV_DRAUGHT_CONSTRAINED = 4,
231 AIS_NAV_MOORED = 5,
232 AIS_NAV_AGROUND = 6,
233 AIS_NAV_FISHING = 7,
234 AIS_NAV_SAILING = 8,
235 AIS_NAV_RESERVED_HSC = 9,
236 AIS_NAV_RESERVED_WIG = 10,
237 AIS_NAV_RESERVED_1 = 11,
238 AIS_NAV_RESERVED_2 = 12,
239 AIS_NAV_RESERVED_3 = 13,
240 #[doc = "Search And Rescue Transponder."]
241 AIS_NAV_AIS_SART = 14,
242 #[doc = "Not available (default)."]
243 AIS_NAV_UNKNOWN = 15,
244}
245impl AisNavStatus {
246 pub const DEFAULT: Self = Self::UNDER_WAY;
247}
248impl Default for AisNavStatus {
249 fn default() -> Self {
250 Self::DEFAULT
251 }
252}
253#[cfg_attr(feature = "ts", derive(TS))]
254#[cfg_attr(feature = "ts", ts(export))]
255#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
256#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
257#[cfg_attr(feature = "serde", serde(tag = "type"))]
258#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
259#[repr(u32)]
260#[doc = "Type of AIS vessel, enum duplicated from AIS standard, <https://gpsd.gitlab.io/gpsd/AIVDM.html>"]
261pub enum AisType {
262 #[doc = "Not available (default)."]
263 AIS_TYPE_UNKNOWN = 0,
264 AIS_TYPE_RESERVED_1 = 1,
265 AIS_TYPE_RESERVED_2 = 2,
266 AIS_TYPE_RESERVED_3 = 3,
267 AIS_TYPE_RESERVED_4 = 4,
268 AIS_TYPE_RESERVED_5 = 5,
269 AIS_TYPE_RESERVED_6 = 6,
270 AIS_TYPE_RESERVED_7 = 7,
271 AIS_TYPE_RESERVED_8 = 8,
272 AIS_TYPE_RESERVED_9 = 9,
273 AIS_TYPE_RESERVED_10 = 10,
274 AIS_TYPE_RESERVED_11 = 11,
275 AIS_TYPE_RESERVED_12 = 12,
276 AIS_TYPE_RESERVED_13 = 13,
277 AIS_TYPE_RESERVED_14 = 14,
278 AIS_TYPE_RESERVED_15 = 15,
279 AIS_TYPE_RESERVED_16 = 16,
280 AIS_TYPE_RESERVED_17 = 17,
281 AIS_TYPE_RESERVED_18 = 18,
282 AIS_TYPE_RESERVED_19 = 19,
283 #[doc = "Wing In Ground effect."]
284 AIS_TYPE_WIG = 20,
285 AIS_TYPE_WIG_HAZARDOUS_A = 21,
286 AIS_TYPE_WIG_HAZARDOUS_B = 22,
287 AIS_TYPE_WIG_HAZARDOUS_C = 23,
288 AIS_TYPE_WIG_HAZARDOUS_D = 24,
289 AIS_TYPE_WIG_RESERVED_1 = 25,
290 AIS_TYPE_WIG_RESERVED_2 = 26,
291 AIS_TYPE_WIG_RESERVED_3 = 27,
292 AIS_TYPE_WIG_RESERVED_4 = 28,
293 AIS_TYPE_WIG_RESERVED_5 = 29,
294 AIS_TYPE_FISHING = 30,
295 AIS_TYPE_TOWING = 31,
296 #[doc = "Towing: length exceeds 200m or breadth exceeds 25m."]
297 AIS_TYPE_TOWING_LARGE = 32,
298 #[doc = "Dredging or other underwater ops."]
299 AIS_TYPE_DREDGING = 33,
300 AIS_TYPE_DIVING = 34,
301 AIS_TYPE_MILITARY = 35,
302 AIS_TYPE_SAILING = 36,
303 AIS_TYPE_PLEASURE = 37,
304 AIS_TYPE_RESERVED_20 = 38,
305 AIS_TYPE_RESERVED_21 = 39,
306 #[doc = "High Speed Craft."]
307 AIS_TYPE_HSC = 40,
308 AIS_TYPE_HSC_HAZARDOUS_A = 41,
309 AIS_TYPE_HSC_HAZARDOUS_B = 42,
310 AIS_TYPE_HSC_HAZARDOUS_C = 43,
311 AIS_TYPE_HSC_HAZARDOUS_D = 44,
312 AIS_TYPE_HSC_RESERVED_1 = 45,
313 AIS_TYPE_HSC_RESERVED_2 = 46,
314 AIS_TYPE_HSC_RESERVED_3 = 47,
315 AIS_TYPE_HSC_RESERVED_4 = 48,
316 AIS_TYPE_HSC_UNKNOWN = 49,
317 AIS_TYPE_PILOT = 50,
318 #[doc = "Search And Rescue vessel."]
319 AIS_TYPE_SAR = 51,
320 AIS_TYPE_TUG = 52,
321 AIS_TYPE_PORT_TENDER = 53,
322 #[doc = "Anti-pollution equipment."]
323 AIS_TYPE_ANTI_POLLUTION = 54,
324 AIS_TYPE_LAW_ENFORCEMENT = 55,
325 AIS_TYPE_SPARE_LOCAL_1 = 56,
326 AIS_TYPE_SPARE_LOCAL_2 = 57,
327 AIS_TYPE_MEDICAL_TRANSPORT = 58,
328 #[doc = "Noncombatant ship according to RR Resolution No. 18."]
329 AIS_TYPE_NONECOMBATANT = 59,
330 AIS_TYPE_PASSENGER = 60,
331 AIS_TYPE_PASSENGER_HAZARDOUS_A = 61,
332 AIS_TYPE_PASSENGER_HAZARDOUS_B = 62,
333 AIS_TYPE_PASSENGER_HAZARDOUS_C = 63,
334 AIS_TYPE_PASSENGER_HAZARDOUS_D = 64,
335 AIS_TYPE_PASSENGER_RESERVED_1 = 65,
336 AIS_TYPE_PASSENGER_RESERVED_2 = 66,
337 AIS_TYPE_PASSENGER_RESERVED_3 = 67,
338 AIS_TYPE_PASSENGER_RESERVED_4 = 68,
339 AIS_TYPE_PASSENGER_UNKNOWN = 69,
340 AIS_TYPE_CARGO = 70,
341 AIS_TYPE_CARGO_HAZARDOUS_A = 71,
342 AIS_TYPE_CARGO_HAZARDOUS_B = 72,
343 AIS_TYPE_CARGO_HAZARDOUS_C = 73,
344 AIS_TYPE_CARGO_HAZARDOUS_D = 74,
345 AIS_TYPE_CARGO_RESERVED_1 = 75,
346 AIS_TYPE_CARGO_RESERVED_2 = 76,
347 AIS_TYPE_CARGO_RESERVED_3 = 77,
348 AIS_TYPE_CARGO_RESERVED_4 = 78,
349 AIS_TYPE_CARGO_UNKNOWN = 79,
350 AIS_TYPE_TANKER = 80,
351 AIS_TYPE_TANKER_HAZARDOUS_A = 81,
352 AIS_TYPE_TANKER_HAZARDOUS_B = 82,
353 AIS_TYPE_TANKER_HAZARDOUS_C = 83,
354 AIS_TYPE_TANKER_HAZARDOUS_D = 84,
355 AIS_TYPE_TANKER_RESERVED_1 = 85,
356 AIS_TYPE_TANKER_RESERVED_2 = 86,
357 AIS_TYPE_TANKER_RESERVED_3 = 87,
358 AIS_TYPE_TANKER_RESERVED_4 = 88,
359 AIS_TYPE_TANKER_UNKNOWN = 89,
360 AIS_TYPE_OTHER = 90,
361 AIS_TYPE_OTHER_HAZARDOUS_A = 91,
362 AIS_TYPE_OTHER_HAZARDOUS_B = 92,
363 AIS_TYPE_OTHER_HAZARDOUS_C = 93,
364 AIS_TYPE_OTHER_HAZARDOUS_D = 94,
365 AIS_TYPE_OTHER_RESERVED_1 = 95,
366 AIS_TYPE_OTHER_RESERVED_2 = 96,
367 AIS_TYPE_OTHER_RESERVED_3 = 97,
368 AIS_TYPE_OTHER_RESERVED_4 = 98,
369 AIS_TYPE_OTHER_UNKNOWN = 99,
370}
371impl AisType {
372 pub const DEFAULT: Self = Self::AIS_TYPE_UNKNOWN;
373}
374impl Default for AisType {
375 fn default() -> Self {
376 Self::DEFAULT
377 }
378}
379bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b00000000 indicates that none of the setpoint dimensions should be ignored."] pub struct AttitudeTargetTypemask : u8 { # [doc = "Ignore body roll rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_ROLL_RATE_IGNORE = 1 ; # [doc = "Ignore body pitch rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_PITCH_RATE_IGNORE = 2 ; # [doc = "Ignore body yaw rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_YAW_RATE_IGNORE = 4 ; # [doc = "Use 3D body thrust setpoint instead of throttle"] const ATTITUDE_TARGET_TYPEMASK_THRUST_BODY_SET = 32 ; # [doc = "Ignore throttle"] const ATTITUDE_TARGET_TYPEMASK_THROTTLE_IGNORE = 64 ; # [doc = "Ignore attitude"] const ATTITUDE_TARGET_TYPEMASK_ATTITUDE_IGNORE = 128 ; } }
380impl AttitudeTargetTypemask {
381 pub const DEFAULT: Self = Self::ATTITUDE_TARGET_TYPEMASK_BODY_ROLL_RATE_IGNORE;
382}
383impl Default for AttitudeTargetTypemask {
384 fn default() -> Self {
385 Self::DEFAULT
386 }
387}
388#[cfg_attr(feature = "ts", derive(TS))]
389#[cfg_attr(feature = "ts", ts(export))]
390#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
391#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
392#[cfg_attr(feature = "serde", serde(tag = "type"))]
393#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
394#[repr(u32)]
395#[doc = "Axes that will be autotuned by MAV_CMD_DO_AUTOTUNE_ENABLE. Note that at least one flag must be set in MAV_CMD_DO_AUTOTUNE_ENABLE.param2: if none are set, the flight stack will tune its default set of axes."]
396pub enum AutotuneAxis {
397 #[doc = "Autotune roll axis."]
398 AUTOTUNE_AXIS_ROLL = 1,
399 #[doc = "Autotune pitch axis."]
400 AUTOTUNE_AXIS_PITCH = 2,
401 #[doc = "Autotune yaw axis."]
402 AUTOTUNE_AXIS_YAW = 4,
403}
404impl AutotuneAxis {
405 pub const DEFAULT: Self = Self::AUTOTUNE_AXIS_ROLL;
406}
407impl Default for AutotuneAxis {
408 fn default() -> Self {
409 Self::DEFAULT
410 }
411}
412#[cfg_attr(feature = "ts", derive(TS))]
413#[cfg_attr(feature = "ts", ts(export))]
414#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
415#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
416#[cfg_attr(feature = "serde", serde(tag = "type"))]
417#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
418#[repr(u32)]
419pub enum AvssHorseflyOperationMode {
420 #[doc = "In manual control mode"]
421 MODE_HORSEFLY_MANUAL_CTRL = 0,
422 #[doc = "In auto takeoff mode"]
423 MODE_HORSEFLY_AUTO_TAKEOFF = 1,
424 #[doc = "In auto landing mode"]
425 MODE_HORSEFLY_AUTO_LANDING = 2,
426 #[doc = "In go home mode"]
427 MODE_HORSEFLY_NAVI_GO_HOME = 3,
428 #[doc = "In drop mode"]
429 MODE_HORSEFLY_DROP = 4,
430}
431impl AvssHorseflyOperationMode {
432 pub const DEFAULT: Self = Self::MODE_HORSEFLY_MANUAL_CTRL;
433}
434impl Default for AvssHorseflyOperationMode {
435 fn default() -> Self {
436 Self::DEFAULT
437 }
438}
439#[cfg_attr(feature = "ts", derive(TS))]
440#[cfg_attr(feature = "ts", ts(export))]
441#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
442#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
443#[cfg_attr(feature = "serde", serde(tag = "type"))]
444#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
445#[repr(u32)]
446pub enum AvssM300OperationMode {
447 #[doc = "In manual control mode"]
448 MODE_M300_MANUAL_CTRL = 0,
449 #[doc = "In attitude mode"]
450 MODE_M300_ATTITUDE = 1,
451 #[doc = "In GPS mode"]
452 MODE_M300_P_GPS = 6,
453 #[doc = "In hotpoint mode"]
454 MODE_M300_HOTPOINT_MODE = 9,
455 #[doc = "In assisted takeoff mode"]
456 MODE_M300_ASSISTED_TAKEOFF = 10,
457 #[doc = "In auto takeoff mode"]
458 MODE_M300_AUTO_TAKEOFF = 11,
459 #[doc = "In auto landing mode"]
460 MODE_M300_AUTO_LANDING = 12,
461 #[doc = "In go home mode"]
462 MODE_M300_NAVI_GO_HOME = 15,
463 #[doc = "In sdk control mode"]
464 MODE_M300_NAVI_SDK_CTRL = 17,
465 #[doc = "In sport mode"]
466 MODE_M300_S_SPORT = 31,
467 #[doc = "In force auto landing mode"]
468 MODE_M300_FORCE_AUTO_LANDING = 33,
469 #[doc = "In tripod mode"]
470 MODE_M300_T_TRIPOD = 38,
471 #[doc = "In search mode"]
472 MODE_M300_SEARCH_MODE = 40,
473 #[doc = "In engine mode"]
474 MODE_M300_ENGINE_START = 41,
475}
476impl AvssM300OperationMode {
477 pub const DEFAULT: Self = Self::MODE_M300_MANUAL_CTRL;
478}
479impl Default for AvssM300OperationMode {
480 fn default() -> Self {
481 Self::DEFAULT
482 }
483}
484bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Camera capability flags (Bitmap)"] pub struct CameraCapFlags : u32 { # [doc = "Camera is able to record video"] const CAMERA_CAP_FLAGS_CAPTURE_VIDEO = 1 ; # [doc = "Camera is able to capture images"] const CAMERA_CAP_FLAGS_CAPTURE_IMAGE = 2 ; # [doc = "Camera has separate Video and Image/Photo modes (MAV_CMD_SET_CAMERA_MODE)"] const CAMERA_CAP_FLAGS_HAS_MODES = 4 ; # [doc = "Camera can capture images while in video mode"] const CAMERA_CAP_FLAGS_CAN_CAPTURE_IMAGE_IN_VIDEO_MODE = 8 ; # [doc = "Camera can capture videos while in Photo/Image mode"] const CAMERA_CAP_FLAGS_CAN_CAPTURE_VIDEO_IN_IMAGE_MODE = 16 ; # [doc = "Camera has image survey mode (MAV_CMD_SET_CAMERA_MODE)"] const CAMERA_CAP_FLAGS_HAS_IMAGE_SURVEY_MODE = 32 ; # [doc = "Camera has basic zoom control (MAV_CMD_SET_CAMERA_ZOOM)"] const CAMERA_CAP_FLAGS_HAS_BASIC_ZOOM = 64 ; # [doc = "Camera has basic focus control (MAV_CMD_SET_CAMERA_FOCUS)"] const CAMERA_CAP_FLAGS_HAS_BASIC_FOCUS = 128 ; # [doc = "Camera has video streaming capabilities (request VIDEO_STREAM_INFORMATION with MAV_CMD_REQUEST_MESSAGE for video streaming info)"] const CAMERA_CAP_FLAGS_HAS_VIDEO_STREAM = 256 ; # [doc = "Camera supports tracking of a point on the camera view."] const CAMERA_CAP_FLAGS_HAS_TRACKING_POINT = 512 ; # [doc = "Camera supports tracking of a selection rectangle on the camera view."] const CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE = 1024 ; # [doc = "Camera supports tracking geo status (CAMERA_TRACKING_GEO_STATUS)."] const CAMERA_CAP_FLAGS_HAS_TRACKING_GEO_STATUS = 2048 ; # [doc = "Camera supports absolute thermal range (request CAMERA_THERMAL_RANGE with MAV_CMD_REQUEST_MESSAGE)."] const CAMERA_CAP_FLAGS_HAS_THERMAL_RANGE = 4096 ; } }
485impl CameraCapFlags {
486 pub const DEFAULT: Self = Self::CAMERA_CAP_FLAGS_CAPTURE_VIDEO;
487}
488impl Default for CameraCapFlags {
489 fn default() -> Self {
490 Self::DEFAULT
491 }
492}
493#[cfg_attr(feature = "ts", derive(TS))]
494#[cfg_attr(feature = "ts", ts(export))]
495#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
496#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
497#[cfg_attr(feature = "serde", serde(tag = "type"))]
498#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
499#[repr(u32)]
500#[doc = "Camera Modes."]
501pub enum CameraMode {
502 #[doc = "Camera is in image/photo capture mode."]
503 CAMERA_MODE_IMAGE = 0,
504 #[doc = "Camera is in video capture mode."]
505 CAMERA_MODE_VIDEO = 1,
506 #[doc = "Camera is in image survey capture mode. It allows for camera controller to do specific settings for surveys."]
507 CAMERA_MODE_IMAGE_SURVEY = 2,
508}
509impl CameraMode {
510 pub const DEFAULT: Self = Self::CAMERA_MODE_IMAGE;
511}
512impl Default for CameraMode {
513 fn default() -> Self {
514 Self::DEFAULT
515 }
516}
517#[cfg_attr(feature = "ts", derive(TS))]
518#[cfg_attr(feature = "ts", ts(export))]
519#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
520#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
521#[cfg_attr(feature = "serde", serde(tag = "type"))]
522#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
523#[repr(u32)]
524#[doc = "Camera sources for MAV_CMD_SET_CAMERA_SOURCE"]
525pub enum CameraSource {
526 #[doc = "Default camera source."]
527 CAMERA_SOURCE_DEFAULT = 0,
528 #[doc = "RGB camera source."]
529 CAMERA_SOURCE_RGB = 1,
530 #[doc = "IR camera source."]
531 CAMERA_SOURCE_IR = 2,
532 #[doc = "NDVI camera source."]
533 CAMERA_SOURCE_NDVI = 3,
534}
535impl CameraSource {
536 pub const DEFAULT: Self = Self::CAMERA_SOURCE_DEFAULT;
537}
538impl Default for CameraSource {
539 fn default() -> Self {
540 Self::DEFAULT
541 }
542}
543#[cfg_attr(feature = "ts", derive(TS))]
544#[cfg_attr(feature = "ts", ts(export))]
545#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
546#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
547#[cfg_attr(feature = "serde", serde(tag = "type"))]
548#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
549#[repr(u32)]
550#[doc = "Camera tracking modes"]
551pub enum CameraTrackingMode {
552 #[doc = "Not tracking"]
553 CAMERA_TRACKING_MODE_NONE = 0,
554 #[doc = "Target is a point"]
555 CAMERA_TRACKING_MODE_POINT = 1,
556 #[doc = "Target is a rectangle"]
557 CAMERA_TRACKING_MODE_RECTANGLE = 2,
558}
559impl CameraTrackingMode {
560 pub const DEFAULT: Self = Self::CAMERA_TRACKING_MODE_NONE;
561}
562impl Default for CameraTrackingMode {
563 fn default() -> Self {
564 Self::DEFAULT
565 }
566}
567#[cfg_attr(feature = "ts", derive(TS))]
568#[cfg_attr(feature = "ts", ts(export))]
569#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
570#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
571#[cfg_attr(feature = "serde", serde(tag = "type"))]
572#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
573#[repr(u32)]
574#[doc = "Camera tracking status flags"]
575pub enum CameraTrackingStatusFlags {
576 #[doc = "Camera is not tracking"]
577 CAMERA_TRACKING_STATUS_FLAGS_IDLE = 0,
578 #[doc = "Camera is tracking"]
579 CAMERA_TRACKING_STATUS_FLAGS_ACTIVE = 1,
580 #[doc = "Camera tracking in error state"]
581 CAMERA_TRACKING_STATUS_FLAGS_ERROR = 2,
582}
583impl CameraTrackingStatusFlags {
584 pub const DEFAULT: Self = Self::CAMERA_TRACKING_STATUS_FLAGS_IDLE;
585}
586impl Default for CameraTrackingStatusFlags {
587 fn default() -> Self {
588 Self::DEFAULT
589 }
590}
591bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Camera tracking target data (shows where tracked target is within image)"] pub struct CameraTrackingTargetData : u8 { # [doc = "Target data embedded in image data (proprietary)"] const CAMERA_TRACKING_TARGET_DATA_EMBEDDED = 1 ; # [doc = "Target data rendered in image"] const CAMERA_TRACKING_TARGET_DATA_RENDERED = 2 ; # [doc = "Target data within status message (Point or Rectangle)"] const CAMERA_TRACKING_TARGET_DATA_IN_STATUS = 4 ; } }
592impl CameraTrackingTargetData {
593 pub const DEFAULT: Self = Self::CAMERA_TRACKING_TARGET_DATA_EMBEDDED;
594}
595impl Default for CameraTrackingTargetData {
596 fn default() -> Self {
597 Self::DEFAULT
598 }
599}
600#[cfg_attr(feature = "ts", derive(TS))]
601#[cfg_attr(feature = "ts", ts(export))]
602#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
603#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
604#[cfg_attr(feature = "serde", serde(tag = "type"))]
605#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
606#[repr(u32)]
607#[doc = "Zoom types for MAV_CMD_SET_CAMERA_ZOOM"]
608pub enum CameraZoomType {
609 #[doc = "Zoom one step increment (-1 for wide, 1 for tele)"]
610 ZOOM_TYPE_STEP = 0,
611 #[doc = "Continuous normalized zoom in/out rate until stopped. Range -1..1, negative: wide, positive: narrow/tele, 0 to stop zooming. Other values should be clipped to the range."]
612 ZOOM_TYPE_CONTINUOUS = 1,
613 #[doc = "Zoom value as proportion of full camera range (a percentage value between 0.0 and 100.0)"]
614 ZOOM_TYPE_RANGE = 2,
615 #[doc = "Zoom value/variable focal length in millimetres. Note that there is no message to get the valid zoom range of the camera, so this can type can only be used for cameras where the zoom range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera)"]
616 ZOOM_TYPE_FOCAL_LENGTH = 3,
617 #[doc = "Zoom value as horizontal field of view in degrees."]
618 ZOOM_TYPE_HORIZONTAL_FOV = 4,
619}
620impl CameraZoomType {
621 pub const DEFAULT: Self = Self::ZOOM_TYPE_STEP;
622}
623impl Default for CameraZoomType {
624 fn default() -> Self {
625 Self::DEFAULT
626 }
627}
628#[cfg_attr(feature = "ts", derive(TS))]
629#[cfg_attr(feature = "ts", ts(export))]
630#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
631#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
632#[cfg_attr(feature = "serde", serde(tag = "type"))]
633#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
634#[repr(u32)]
635pub enum CanFilterOp {
636 CAN_FILTER_REPLACE = 0,
637 CAN_FILTER_ADD = 1,
638 CAN_FILTER_REMOVE = 2,
639}
640impl CanFilterOp {
641 pub const DEFAULT: Self = Self::CAN_FILTER_REPLACE;
642}
643impl Default for CanFilterOp {
644 fn default() -> Self {
645 Self::DEFAULT
646 }
647}
648#[cfg_attr(feature = "ts", derive(TS))]
649#[cfg_attr(feature = "ts", ts(export))]
650#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
651#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
652#[cfg_attr(feature = "serde", serde(tag = "type"))]
653#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
654#[repr(u32)]
655#[doc = "Possible responses from a CELLULAR_CONFIG message."]
656pub enum CellularConfigResponse {
657 #[doc = "Changes accepted."]
658 CELLULAR_CONFIG_RESPONSE_ACCEPTED = 0,
659 #[doc = "Invalid APN."]
660 CELLULAR_CONFIG_RESPONSE_APN_ERROR = 1,
661 #[doc = "Invalid PIN."]
662 CELLULAR_CONFIG_RESPONSE_PIN_ERROR = 2,
663 #[doc = "Changes rejected."]
664 CELLULAR_CONFIG_RESPONSE_REJECTED = 3,
665 #[doc = "PUK is required to unblock SIM card."]
666 CELLULAR_CONFIG_BLOCKED_PUK_REQUIRED = 4,
667}
668impl CellularConfigResponse {
669 pub const DEFAULT: Self = Self::CELLULAR_CONFIG_RESPONSE_ACCEPTED;
670}
671impl Default for CellularConfigResponse {
672 fn default() -> Self {
673 Self::DEFAULT
674 }
675}
676#[cfg_attr(feature = "ts", derive(TS))]
677#[cfg_attr(feature = "ts", ts(export))]
678#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
679#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
680#[cfg_attr(feature = "serde", serde(tag = "type"))]
681#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
682#[repr(u32)]
683#[doc = "These flags are used to diagnose the failure state of CELLULAR_STATUS"]
684pub enum CellularNetworkFailedReason {
685 #[doc = "No error"]
686 CELLULAR_NETWORK_FAILED_REASON_NONE = 0,
687 #[doc = "Error state is unknown"]
688 CELLULAR_NETWORK_FAILED_REASON_UNKNOWN = 1,
689 #[doc = "SIM is required for the modem but missing"]
690 CELLULAR_NETWORK_FAILED_REASON_SIM_MISSING = 2,
691 #[doc = "SIM is available, but not usable for connection"]
692 CELLULAR_NETWORK_FAILED_REASON_SIM_ERROR = 3,
693}
694impl CellularNetworkFailedReason {
695 pub const DEFAULT: Self = Self::CELLULAR_NETWORK_FAILED_REASON_NONE;
696}
697impl Default for CellularNetworkFailedReason {
698 fn default() -> Self {
699 Self::DEFAULT
700 }
701}
702#[cfg_attr(feature = "ts", derive(TS))]
703#[cfg_attr(feature = "ts", ts(export))]
704#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
705#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
706#[cfg_attr(feature = "serde", serde(tag = "type"))]
707#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
708#[repr(u32)]
709#[doc = "Cellular network radio type"]
710pub enum CellularNetworkRadioType {
711 CELLULAR_NETWORK_RADIO_TYPE_NONE = 0,
712 CELLULAR_NETWORK_RADIO_TYPE_GSM = 1,
713 CELLULAR_NETWORK_RADIO_TYPE_CDMA = 2,
714 CELLULAR_NETWORK_RADIO_TYPE_WCDMA = 3,
715 CELLULAR_NETWORK_RADIO_TYPE_LTE = 4,
716}
717impl CellularNetworkRadioType {
718 pub const DEFAULT: Self = Self::CELLULAR_NETWORK_RADIO_TYPE_NONE;
719}
720impl Default for CellularNetworkRadioType {
721 fn default() -> Self {
722 Self::DEFAULT
723 }
724}
725#[cfg_attr(feature = "ts", derive(TS))]
726#[cfg_attr(feature = "ts", ts(export))]
727#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
728#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
729#[cfg_attr(feature = "serde", serde(tag = "type"))]
730#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
731#[repr(u32)]
732#[doc = "These flags encode the cellular network status"]
733pub enum CellularStatusFlag {
734 #[doc = "State unknown or not reportable."]
735 CELLULAR_STATUS_FLAG_UNKNOWN = 0,
736 #[doc = "Modem is unusable"]
737 CELLULAR_STATUS_FLAG_FAILED = 1,
738 #[doc = "Modem is being initialized"]
739 CELLULAR_STATUS_FLAG_INITIALIZING = 2,
740 #[doc = "Modem is locked"]
741 CELLULAR_STATUS_FLAG_LOCKED = 3,
742 #[doc = "Modem is not enabled and is powered down"]
743 CELLULAR_STATUS_FLAG_DISABLED = 4,
744 #[doc = "Modem is currently transitioning to the CELLULAR_STATUS_FLAG_DISABLED state"]
745 CELLULAR_STATUS_FLAG_DISABLING = 5,
746 #[doc = "Modem is currently transitioning to the CELLULAR_STATUS_FLAG_ENABLED state"]
747 CELLULAR_STATUS_FLAG_ENABLING = 6,
748 #[doc = "Modem is enabled and powered on but not registered with a network provider and not available for data connections"]
749 CELLULAR_STATUS_FLAG_ENABLED = 7,
750 #[doc = "Modem is searching for a network provider to register"]
751 CELLULAR_STATUS_FLAG_SEARCHING = 8,
752 #[doc = "Modem is registered with a network provider, and data connections and messaging may be available for use"]
753 CELLULAR_STATUS_FLAG_REGISTERED = 9,
754 #[doc = "Modem is disconnecting and deactivating the last active packet data bearer. This state will not be entered if more than one packet data bearer is active and one of the active bearers is deactivated"]
755 CELLULAR_STATUS_FLAG_DISCONNECTING = 10,
756 #[doc = "Modem is activating and connecting the first packet data bearer. Subsequent bearer activations when another bearer is already active do not cause this state to be entered"]
757 CELLULAR_STATUS_FLAG_CONNECTING = 11,
758 #[doc = "One or more packet data bearers is active and connected"]
759 CELLULAR_STATUS_FLAG_CONNECTED = 12,
760}
761impl CellularStatusFlag {
762 pub const DEFAULT: Self = Self::CELLULAR_STATUS_FLAG_UNKNOWN;
763}
764impl Default for CellularStatusFlag {
765 fn default() -> Self {
766 Self::DEFAULT
767 }
768}
769#[cfg_attr(feature = "ts", derive(TS))]
770#[cfg_attr(feature = "ts", ts(export))]
771#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
772#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
773#[cfg_attr(feature = "serde", serde(tag = "type"))]
774#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
775#[repr(u32)]
776#[doc = "Supported component metadata types. These are used in the \"general\" metadata file returned by COMPONENT_METADATA to provide information about supported metadata types. The types are not used directly in MAVLink messages."]
777pub enum CompMetadataType {
778 #[doc = "General information about the component. General metadata includes information about other metadata types supported by the component. Files of this type must be supported, and must be downloadable from vehicle using a MAVLink FTP URI."]
779 COMP_METADATA_TYPE_GENERAL = 0,
780 #[doc = "Parameter meta data."]
781 COMP_METADATA_TYPE_PARAMETER = 1,
782 #[doc = "Meta data that specifies which commands and command parameters the vehicle supports. (WIP)"]
783 COMP_METADATA_TYPE_COMMANDS = 2,
784 #[doc = "Meta data that specifies external non-MAVLink peripherals."]
785 COMP_METADATA_TYPE_PERIPHERALS = 3,
786 #[doc = "Meta data for the events interface."]
787 COMP_METADATA_TYPE_EVENTS = 4,
788 #[doc = "Meta data for actuator configuration (motors, servos and vehicle geometry) and testing."]
789 COMP_METADATA_TYPE_ACTUATORS = 5,
790}
791impl CompMetadataType {
792 pub const DEFAULT: Self = Self::COMP_METADATA_TYPE_GENERAL;
793}
794impl Default for CompMetadataType {
795 fn default() -> Self {
796 Self::DEFAULT
797 }
798}
799#[cfg_attr(feature = "ts", derive(TS))]
800#[cfg_attr(feature = "ts", ts(export))]
801#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
802#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
803#[cfg_attr(feature = "serde", serde(tag = "type"))]
804#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
805#[repr(u32)]
806#[doc = "Indicates the ESC connection type."]
807pub enum EscConnectionType {
808 #[doc = "Traditional PPM ESC."]
809 ESC_CONNECTION_TYPE_PPM = 0,
810 #[doc = "Serial Bus connected ESC."]
811 ESC_CONNECTION_TYPE_SERIAL = 1,
812 #[doc = "One Shot PPM ESC."]
813 ESC_CONNECTION_TYPE_ONESHOT = 2,
814 #[doc = "I2C ESC."]
815 ESC_CONNECTION_TYPE_I2C = 3,
816 #[doc = "CAN-Bus ESC."]
817 ESC_CONNECTION_TYPE_CAN = 4,
818 #[doc = "DShot ESC."]
819 ESC_CONNECTION_TYPE_DSHOT = 5,
820}
821impl EscConnectionType {
822 pub const DEFAULT: Self = Self::ESC_CONNECTION_TYPE_PPM;
823}
824impl Default for EscConnectionType {
825 fn default() -> Self {
826 Self::DEFAULT
827 }
828}
829bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report ESC failures."] pub struct EscFailureFlags : u16 { # [doc = "Over current failure."] const ESC_FAILURE_OVER_CURRENT = 1 ; # [doc = "Over voltage failure."] const ESC_FAILURE_OVER_VOLTAGE = 2 ; # [doc = "Over temperature failure."] const ESC_FAILURE_OVER_TEMPERATURE = 4 ; # [doc = "Over RPM failure."] const ESC_FAILURE_OVER_RPM = 8 ; # [doc = "Inconsistent command failure i.e. out of bounds."] const ESC_FAILURE_INCONSISTENT_CMD = 16 ; # [doc = "Motor stuck failure."] const ESC_FAILURE_MOTOR_STUCK = 32 ; # [doc = "Generic ESC failure."] const ESC_FAILURE_GENERIC = 64 ; } }
830impl EscFailureFlags {
831 pub const DEFAULT: Self = Self::ESC_FAILURE_OVER_CURRENT;
832}
833impl Default for EscFailureFlags {
834 fn default() -> Self {
835 Self::DEFAULT
836 }
837}
838bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in ESTIMATOR_STATUS message"] pub struct EstimatorStatusFlags : u16 { # [doc = "True if the attitude estimate is good"] const ESTIMATOR_ATTITUDE = 1 ; # [doc = "True if the horizontal velocity estimate is good"] const ESTIMATOR_VELOCITY_HORIZ = 2 ; # [doc = "True if the vertical velocity estimate is good"] const ESTIMATOR_VELOCITY_VERT = 4 ; # [doc = "True if the horizontal position (relative) estimate is good"] const ESTIMATOR_POS_HORIZ_REL = 8 ; # [doc = "True if the horizontal position (absolute) estimate is good"] const ESTIMATOR_POS_HORIZ_ABS = 16 ; # [doc = "True if the vertical position (absolute) estimate is good"] const ESTIMATOR_POS_VERT_ABS = 32 ; # [doc = "True if the vertical position (above ground) estimate is good"] const ESTIMATOR_POS_VERT_AGL = 64 ; # [doc = "True if the EKF is in a constant position mode and is not using external measurements (eg GPS or optical flow)"] const ESTIMATOR_CONST_POS_MODE = 128 ; # [doc = "True if the EKF has sufficient data to enter a mode that will provide a (relative) position estimate"] const ESTIMATOR_PRED_POS_HORIZ_REL = 256 ; # [doc = "True if the EKF has sufficient data to enter a mode that will provide a (absolute) position estimate"] const ESTIMATOR_PRED_POS_HORIZ_ABS = 512 ; # [doc = "True if the EKF has detected a GPS glitch"] const ESTIMATOR_GPS_GLITCH = 1024 ; # [doc = "True if the EKF has detected bad accelerometer data"] const ESTIMATOR_ACCEL_ERROR = 2048 ; } }
839impl EstimatorStatusFlags {
840 pub const DEFAULT: Self = Self::ESTIMATOR_ATTITUDE;
841}
842impl Default for EstimatorStatusFlags {
843 fn default() -> Self {
844 Self::DEFAULT
845 }
846}
847#[cfg_attr(feature = "ts", derive(TS))]
848#[cfg_attr(feature = "ts", ts(export))]
849#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
850#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
851#[cfg_attr(feature = "serde", serde(tag = "type"))]
852#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
853#[repr(u32)]
854#[doc = "List of possible failure type to inject."]
855pub enum FailureType {
856 #[doc = "No failure injected, used to reset a previous failure."]
857 FAILURE_TYPE_OK = 0,
858 #[doc = "Sets unit off, so completely non-responsive."]
859 FAILURE_TYPE_OFF = 1,
860 #[doc = "Unit is stuck e.g. keeps reporting the same value."]
861 FAILURE_TYPE_STUCK = 2,
862 #[doc = "Unit is reporting complete garbage."]
863 FAILURE_TYPE_GARBAGE = 3,
864 #[doc = "Unit is consistently wrong."]
865 FAILURE_TYPE_WRONG = 4,
866 #[doc = "Unit is slow, so e.g. reporting at slower than expected rate."]
867 FAILURE_TYPE_SLOW = 5,
868 #[doc = "Data of unit is delayed in time."]
869 FAILURE_TYPE_DELAYED = 6,
870 #[doc = "Unit is sometimes working, sometimes not."]
871 FAILURE_TYPE_INTERMITTENT = 7,
872}
873impl FailureType {
874 pub const DEFAULT: Self = Self::FAILURE_TYPE_OK;
875}
876impl Default for FailureType {
877 fn default() -> Self {
878 Self::DEFAULT
879 }
880}
881#[cfg_attr(feature = "ts", derive(TS))]
882#[cfg_attr(feature = "ts", ts(export))]
883#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
884#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
885#[cfg_attr(feature = "serde", serde(tag = "type"))]
886#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
887#[repr(u32)]
888#[doc = "List of possible units where failures can be injected."]
889pub enum FailureUnit {
890 FAILURE_UNIT_SENSOR_GYRO = 0,
891 FAILURE_UNIT_SENSOR_ACCEL = 1,
892 FAILURE_UNIT_SENSOR_MAG = 2,
893 FAILURE_UNIT_SENSOR_BARO = 3,
894 FAILURE_UNIT_SENSOR_GPS = 4,
895 FAILURE_UNIT_SENSOR_OPTICAL_FLOW = 5,
896 FAILURE_UNIT_SENSOR_VIO = 6,
897 FAILURE_UNIT_SENSOR_DISTANCE_SENSOR = 7,
898 FAILURE_UNIT_SENSOR_AIRSPEED = 8,
899 FAILURE_UNIT_SYSTEM_BATTERY = 100,
900 FAILURE_UNIT_SYSTEM_MOTOR = 101,
901 FAILURE_UNIT_SYSTEM_SERVO = 102,
902 FAILURE_UNIT_SYSTEM_AVOIDANCE = 103,
903 FAILURE_UNIT_SYSTEM_RC_SIGNAL = 104,
904 FAILURE_UNIT_SYSTEM_MAVLINK_SIGNAL = 105,
905}
906impl FailureUnit {
907 pub const DEFAULT: Self = Self::FAILURE_UNIT_SENSOR_GYRO;
908}
909impl Default for FailureUnit {
910 fn default() -> Self {
911 Self::DEFAULT
912 }
913}
914#[cfg_attr(feature = "ts", derive(TS))]
915#[cfg_attr(feature = "ts", ts(export))]
916#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
917#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
918#[cfg_attr(feature = "serde", serde(tag = "type"))]
919#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
920#[repr(u32)]
921pub enum FenceBreach {
922 #[doc = "No last fence breach"]
923 FENCE_BREACH_NONE = 0,
924 #[doc = "Breached minimum altitude"]
925 FENCE_BREACH_MINALT = 1,
926 #[doc = "Breached maximum altitude"]
927 FENCE_BREACH_MAXALT = 2,
928 #[doc = "Breached fence boundary"]
929 FENCE_BREACH_BOUNDARY = 3,
930}
931impl FenceBreach {
932 pub const DEFAULT: Self = Self::FENCE_BREACH_NONE;
933}
934impl Default for FenceBreach {
935 fn default() -> Self {
936 Self::DEFAULT
937 }
938}
939#[cfg_attr(feature = "ts", derive(TS))]
940#[cfg_attr(feature = "ts", ts(export))]
941#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
942#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
943#[cfg_attr(feature = "serde", serde(tag = "type"))]
944#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
945#[repr(u32)]
946#[doc = "Actions being taken to mitigate/prevent fence breach"]
947pub enum FenceMitigate {
948 #[doc = "Unknown"]
949 FENCE_MITIGATE_UNKNOWN = 0,
950 #[doc = "No actions being taken"]
951 FENCE_MITIGATE_NONE = 1,
952 #[doc = "Velocity limiting active to prevent breach"]
953 FENCE_MITIGATE_VEL_LIMIT = 2,
954}
955impl FenceMitigate {
956 pub const DEFAULT: Self = Self::FENCE_MITIGATE_UNKNOWN;
957}
958impl Default for FenceMitigate {
959 fn default() -> Self {
960 Self::DEFAULT
961 }
962}
963#[cfg_attr(feature = "ts", derive(TS))]
964#[cfg_attr(feature = "ts", ts(export))]
965#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
966#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
967#[cfg_attr(feature = "serde", serde(tag = "type"))]
968#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
969#[repr(u32)]
970#[doc = "Fence types to enable or disable when using MAV_CMD_DO_FENCE_ENABLE. Note that at least one of these flags must be set in MAV_CMD_DO_FENCE_ENABLE.param2. If none are set, the flight stack will ignore the field and enable/disable its default set of fences (usually all of them)."]
971pub enum FenceType {
972 #[doc = "Maximum altitude fence"]
973 FENCE_TYPE_ALT_MAX = 1,
974 #[doc = "Circle fence"]
975 FENCE_TYPE_CIRCLE = 2,
976 #[doc = "Polygon fence"]
977 FENCE_TYPE_POLYGON = 4,
978 #[doc = "Minimum altitude fence"]
979 FENCE_TYPE_ALT_MIN = 8,
980}
981impl FenceType {
982 pub const DEFAULT: Self = Self::FENCE_TYPE_ALT_MAX;
983}
984impl Default for FenceType {
985 fn default() -> Self {
986 Self::DEFAULT
987 }
988}
989#[cfg_attr(feature = "ts", derive(TS))]
990#[cfg_attr(feature = "ts", ts(export))]
991#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
992#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
993#[cfg_attr(feature = "serde", serde(tag = "type"))]
994#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
995#[repr(u32)]
996#[doc = "These values define the type of firmware release. These values indicate the first version or release of this type. For example the first alpha release would be 64, the second would be 65."]
997pub enum FirmwareVersionType {
998 #[doc = "development release"]
999 FIRMWARE_VERSION_TYPE_DEV = 0,
1000 #[doc = "alpha release"]
1001 FIRMWARE_VERSION_TYPE_ALPHA = 64,
1002 #[doc = "beta release"]
1003 FIRMWARE_VERSION_TYPE_BETA = 128,
1004 #[doc = "release candidate"]
1005 FIRMWARE_VERSION_TYPE_RC = 192,
1006 #[doc = "official stable release"]
1007 FIRMWARE_VERSION_TYPE_OFFICIAL = 255,
1008}
1009impl FirmwareVersionType {
1010 pub const DEFAULT: Self = Self::FIRMWARE_VERSION_TYPE_DEV;
1011}
1012impl Default for FirmwareVersionType {
1013 fn default() -> Self {
1014 Self::DEFAULT
1015 }
1016}
1017bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal device (low level) capability flags (bitmap)."] pub struct GimbalDeviceCapFlags : u16 { # [doc = "Gimbal device supports a retracted position."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT = 1 ; # [doc = "Gimbal device supports a horizontal, forward looking position, stabilized."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL = 2 ; # [doc = "Gimbal device supports rotating around roll axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS = 4 ; # [doc = "Gimbal device supports to follow a roll angle relative to the vehicle."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW = 8 ; # [doc = "Gimbal device supports locking to a roll angle (generally that's the default with roll stabilized)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK = 16 ; # [doc = "Gimbal device supports rotating around pitch axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS = 32 ; # [doc = "Gimbal device supports to follow a pitch angle relative to the vehicle."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW = 64 ; # [doc = "Gimbal device supports locking to a pitch angle (generally that's the default with pitch stabilized)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK = 128 ; # [doc = "Gimbal device supports rotating around yaw axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS = 256 ; # [doc = "Gimbal device supports to follow a yaw angle relative to the vehicle (generally that's the default)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW = 512 ; # [doc = "Gimbal device supports locking to an absolute heading, i.e., yaw angle relative to North (earth frame, often this is an option available)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK = 1024 ; # [doc = "Gimbal device supports yawing/panning infinitely (e.g. using slip disk)."] const GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW = 2048 ; # [doc = "Gimbal device supports yaw angles and angular velocities relative to North (earth frame). This usually requires support by an autopilot via AUTOPILOT_STATE_FOR_GIMBAL_DEVICE. Support can go on and off during runtime, which is reported by the flag GIMBAL_DEVICE_FLAGS_CAN_ACCEPT_YAW_IN_EARTH_FRAME."] const GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME = 4096 ; # [doc = "Gimbal device supports radio control inputs as an alternative input for controlling the gimbal orientation."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_RC_INPUTS = 8192 ; } }
1018impl GimbalDeviceCapFlags {
1019 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT;
1020}
1021impl Default for GimbalDeviceCapFlags {
1022 fn default() -> Self {
1023 Self::DEFAULT
1024 }
1025}
1026bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal device (low level) error flags (bitmap, 0 means no error)"] pub struct GimbalDeviceErrorFlags : u32 { # [doc = "Gimbal device is limited by hardware roll limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_ROLL_LIMIT = 1 ; # [doc = "Gimbal device is limited by hardware pitch limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_PITCH_LIMIT = 2 ; # [doc = "Gimbal device is limited by hardware yaw limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_YAW_LIMIT = 4 ; # [doc = "There is an error with the gimbal encoders."] const GIMBAL_DEVICE_ERROR_FLAGS_ENCODER_ERROR = 8 ; # [doc = "There is an error with the gimbal power source."] const GIMBAL_DEVICE_ERROR_FLAGS_POWER_ERROR = 16 ; # [doc = "There is an error with the gimbal motors."] const GIMBAL_DEVICE_ERROR_FLAGS_MOTOR_ERROR = 32 ; # [doc = "There is an error with the gimbal's software."] const GIMBAL_DEVICE_ERROR_FLAGS_SOFTWARE_ERROR = 64 ; # [doc = "There is an error with the gimbal's communication."] const GIMBAL_DEVICE_ERROR_FLAGS_COMMS_ERROR = 128 ; # [doc = "Gimbal device is currently calibrating."] const GIMBAL_DEVICE_ERROR_FLAGS_CALIBRATION_RUNNING = 256 ; # [doc = "Gimbal device is not assigned to a gimbal manager."] const GIMBAL_DEVICE_ERROR_FLAGS_NO_MANAGER = 512 ; } }
1027impl GimbalDeviceErrorFlags {
1028 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_ERROR_FLAGS_AT_ROLL_LIMIT;
1029}
1030impl Default for GimbalDeviceErrorFlags {
1031 fn default() -> Self {
1032 Self::DEFAULT
1033 }
1034}
1035bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for gimbal device (lower level) operation."] pub struct GimbalDeviceFlags : u16 { # [doc = "Set to retracted safe position (no stabilization), takes precedence over all other flags."] const GIMBAL_DEVICE_FLAGS_RETRACT = 1 ; # [doc = "Set to neutral/default position, taking precedence over all other flags except RETRACT. Neutral is commonly forward-facing and horizontal (roll=pitch=yaw=0) but may be any orientation."] const GIMBAL_DEVICE_FLAGS_NEUTRAL = 2 ; # [doc = "Lock roll angle to absolute angle relative to horizon (not relative to vehicle). This is generally the default with a stabilizing gimbal."] const GIMBAL_DEVICE_FLAGS_ROLL_LOCK = 4 ; # [doc = "Lock pitch angle to absolute angle relative to horizon (not relative to vehicle). This is generally the default with a stabilizing gimbal."] const GIMBAL_DEVICE_FLAGS_PITCH_LOCK = 8 ; # [doc = "Lock yaw angle to absolute angle relative to North (not relative to vehicle). If this flag is set, the yaw angle and z component of angular velocity are relative to North (earth frame, x-axis pointing North), else they are relative to the vehicle heading (vehicle frame, earth frame rotated so that the x-axis is pointing forward)."] const GIMBAL_DEVICE_FLAGS_YAW_LOCK = 16 ; # [doc = "Yaw angle and z component of angular velocity are relative to the vehicle heading (vehicle frame, earth frame rotated such that the x-axis is pointing forward)."] const GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME = 32 ; # [doc = "Yaw angle and z component of angular velocity are relative to North (earth frame, x-axis is pointing North)."] const GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME = 64 ; # [doc = "Gimbal device can accept yaw angle inputs relative to North (earth frame). This flag is only for reporting (attempts to set this flag are ignored)."] const GIMBAL_DEVICE_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME = 128 ; # [doc = "The gimbal orientation is set exclusively by the RC signals feed to the gimbal's radio control inputs. MAVLink messages for setting the gimbal orientation (GIMBAL_DEVICE_SET_ATTITUDE) are ignored."] const GIMBAL_DEVICE_FLAGS_RC_EXCLUSIVE = 256 ; # [doc = "The gimbal orientation is determined by combining/mixing the RC signals feed to the gimbal's radio control inputs and the MAVLink messages for setting the gimbal orientation (GIMBAL_DEVICE_SET_ATTITUDE). How these two controls are combined or mixed is not defined by the protocol but is up to the implementation."] const GIMBAL_DEVICE_FLAGS_RC_MIXED = 512 ; } }
1036impl GimbalDeviceFlags {
1037 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_FLAGS_RETRACT;
1038}
1039impl Default for GimbalDeviceFlags {
1040 fn default() -> Self {
1041 Self::DEFAULT
1042 }
1043}
1044bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal manager high level capability flags (bitmap). The first 16 bits are identical to the GIMBAL_DEVICE_CAP_FLAGS. However, the gimbal manager does not need to copy the flags from the gimbal but can also enhance the capabilities and thus add flags."] pub struct GimbalManagerCapFlags : u32 { # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_RETRACT = 1 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_NEUTRAL = 2 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_AXIS = 4 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_FOLLOW = 8 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_LOCK = 16 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_AXIS = 32 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_FOLLOW = 64 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_LOCK = 128 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_AXIS = 256 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_FOLLOW = 512 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_LOCK = 1024 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW."] const GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_INFINITE_YAW = 2048 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME = 4096 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RC_INPUTS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_RC_INPUTS = 8192 ; # [doc = "Gimbal manager supports to point to a local position."] const GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_LOCAL = 65536 ; # [doc = "Gimbal manager supports to point to a global latitude, longitude, altitude position."] const GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_GLOBAL = 131072 ; } }
1045impl GimbalManagerCapFlags {
1046 pub const DEFAULT: Self = Self::GIMBAL_MANAGER_CAP_FLAGS_HAS_RETRACT;
1047}
1048impl Default for GimbalManagerCapFlags {
1049 fn default() -> Self {
1050 Self::DEFAULT
1051 }
1052}
1053bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for high level gimbal manager operation The first 16 bits are identical to the GIMBAL_DEVICE_FLAGS."] pub struct GimbalManagerFlags : u32 { # [doc = "Based on GIMBAL_DEVICE_FLAGS_RETRACT."] const GIMBAL_MANAGER_FLAGS_RETRACT = 1 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_NEUTRAL."] const GIMBAL_MANAGER_FLAGS_NEUTRAL = 2 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_ROLL_LOCK."] const GIMBAL_MANAGER_FLAGS_ROLL_LOCK = 4 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_PITCH_LOCK."] const GIMBAL_MANAGER_FLAGS_PITCH_LOCK = 8 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_LOCK."] const GIMBAL_MANAGER_FLAGS_YAW_LOCK = 16 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME."] const GIMBAL_MANAGER_FLAGS_YAW_IN_VEHICLE_FRAME = 32 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_FLAGS_YAW_IN_EARTH_FRAME = 64 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME = 128 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_RC_EXCLUSIVE."] const GIMBAL_MANAGER_FLAGS_RC_EXCLUSIVE = 256 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_RC_MIXED."] const GIMBAL_MANAGER_FLAGS_RC_MIXED = 512 ; } }
1054impl GimbalManagerFlags {
1055 pub const DEFAULT: Self = Self::GIMBAL_MANAGER_FLAGS_RETRACT;
1056}
1057impl Default for GimbalManagerFlags {
1058 fn default() -> Self {
1059 Self::DEFAULT
1060 }
1061}
1062#[cfg_attr(feature = "ts", derive(TS))]
1063#[cfg_attr(feature = "ts", ts(export))]
1064#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1065#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1066#[cfg_attr(feature = "serde", serde(tag = "type"))]
1067#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1068#[repr(u32)]
1069#[doc = "Type of GPS fix"]
1070pub enum GpsFixType {
1071 #[doc = "No GPS connected"]
1072 GPS_FIX_TYPE_NO_GPS = 0,
1073 #[doc = "No position information, GPS is connected"]
1074 GPS_FIX_TYPE_NO_FIX = 1,
1075 #[doc = "2D position"]
1076 GPS_FIX_TYPE_2D_FIX = 2,
1077 #[doc = "3D position"]
1078 GPS_FIX_TYPE_3D_FIX = 3,
1079 #[doc = "DGPS/SBAS aided 3D position"]
1080 GPS_FIX_TYPE_DGPS = 4,
1081 #[doc = "RTK float, 3D position"]
1082 GPS_FIX_TYPE_RTK_FLOAT = 5,
1083 #[doc = "RTK Fixed, 3D position"]
1084 GPS_FIX_TYPE_RTK_FIXED = 6,
1085 #[doc = "Static fixed, typically used for base stations"]
1086 GPS_FIX_TYPE_STATIC = 7,
1087 #[doc = "PPP, 3D position."]
1088 GPS_FIX_TYPE_PPP = 8,
1089}
1090impl GpsFixType {
1091 pub const DEFAULT: Self = Self::GPS_FIX_TYPE_NO_GPS;
1092}
1093impl Default for GpsFixType {
1094 fn default() -> Self {
1095 Self::DEFAULT
1096 }
1097}
1098bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] pub struct GpsInputIgnoreFlags : u16 { # [doc = "ignore altitude field"] const GPS_INPUT_IGNORE_FLAG_ALT = 1 ; # [doc = "ignore hdop field"] const GPS_INPUT_IGNORE_FLAG_HDOP = 2 ; # [doc = "ignore vdop field"] const GPS_INPUT_IGNORE_FLAG_VDOP = 4 ; # [doc = "ignore horizontal velocity field (vn and ve)"] const GPS_INPUT_IGNORE_FLAG_VEL_HORIZ = 8 ; # [doc = "ignore vertical velocity field (vd)"] const GPS_INPUT_IGNORE_FLAG_VEL_VERT = 16 ; # [doc = "ignore speed accuracy field"] const GPS_INPUT_IGNORE_FLAG_SPEED_ACCURACY = 32 ; # [doc = "ignore horizontal accuracy field"] const GPS_INPUT_IGNORE_FLAG_HORIZONTAL_ACCURACY = 64 ; # [doc = "ignore vertical accuracy field"] const GPS_INPUT_IGNORE_FLAG_VERTICAL_ACCURACY = 128 ; } }
1099impl GpsInputIgnoreFlags {
1100 pub const DEFAULT: Self = Self::GPS_INPUT_IGNORE_FLAG_ALT;
1101}
1102impl Default for GpsInputIgnoreFlags {
1103 fn default() -> Self {
1104 Self::DEFAULT
1105 }
1106}
1107#[cfg_attr(feature = "ts", derive(TS))]
1108#[cfg_attr(feature = "ts", ts(export))]
1109#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1110#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1111#[cfg_attr(feature = "serde", serde(tag = "type"))]
1112#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1113#[repr(u32)]
1114#[doc = "Gripper actions."]
1115pub enum GripperActions {
1116 #[doc = "Gripper release cargo."]
1117 GRIPPER_ACTION_RELEASE = 0,
1118 #[doc = "Gripper grab onto cargo."]
1119 GRIPPER_ACTION_GRAB = 1,
1120}
1121impl GripperActions {
1122 pub const DEFAULT: Self = Self::GRIPPER_ACTION_RELEASE;
1123}
1124impl Default for GripperActions {
1125 fn default() -> Self {
1126 Self::DEFAULT
1127 }
1128}
1129bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in the HIGHRES_IMU message indicate which fields have updated since the last message"] pub struct HighresImuUpdatedFlags : u16 { # [doc = "The value in the xacc field has been updated"] const HIGHRES_IMU_UPDATED_XACC = 1 ; # [doc = "The value in the yacc field has been updated"] const HIGHRES_IMU_UPDATED_YACC = 2 ; # [doc = "The value in the zacc field has been updated since"] const HIGHRES_IMU_UPDATED_ZACC = 4 ; # [doc = "The value in the xgyro field has been updated"] const HIGHRES_IMU_UPDATED_XGYRO = 8 ; # [doc = "The value in the ygyro field has been updated"] const HIGHRES_IMU_UPDATED_YGYRO = 16 ; # [doc = "The value in the zgyro field has been updated"] const HIGHRES_IMU_UPDATED_ZGYRO = 32 ; # [doc = "The value in the xmag field has been updated"] const HIGHRES_IMU_UPDATED_XMAG = 64 ; # [doc = "The value in the ymag field has been updated"] const HIGHRES_IMU_UPDATED_YMAG = 128 ; # [doc = "The value in the zmag field has been updated"] const HIGHRES_IMU_UPDATED_ZMAG = 256 ; # [doc = "The value in the abs_pressure field has been updated"] const HIGHRES_IMU_UPDATED_ABS_PRESSURE = 512 ; # [doc = "The value in the diff_pressure field has been updated"] const HIGHRES_IMU_UPDATED_DIFF_PRESSURE = 1024 ; # [doc = "The value in the pressure_alt field has been updated"] const HIGHRES_IMU_UPDATED_PRESSURE_ALT = 2048 ; # [doc = "The value in the temperature field has been updated"] const HIGHRES_IMU_UPDATED_TEMPERATURE = 4096 ; } }
1130impl HighresImuUpdatedFlags {
1131 pub const DEFAULT: Self = Self::HIGHRES_IMU_UPDATED_XACC;
1132}
1133impl Default for HighresImuUpdatedFlags {
1134 fn default() -> Self {
1135 Self::DEFAULT
1136 }
1137}
1138bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags used in HIL_ACTUATOR_CONTROLS message."] pub struct HilActuatorControlsFlags : u64 { # [doc = "Simulation is using lockstep"] const HIL_ACTUATOR_CONTROLS_FLAGS_LOCKSTEP = 1 ; } }
1139impl HilActuatorControlsFlags {
1140 pub const DEFAULT: Self = Self::HIL_ACTUATOR_CONTROLS_FLAGS_LOCKSTEP;
1141}
1142impl Default for HilActuatorControlsFlags {
1143 fn default() -> Self {
1144 Self::DEFAULT
1145 }
1146}
1147bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in the HIL_SENSOR message indicate which fields have updated since the last message"] pub struct HilSensorUpdatedFlags : u32 { # [doc = "The value in the xacc field has been updated"] const HIL_SENSOR_UPDATED_XACC = 1 ; # [doc = "The value in the yacc field has been updated"] const HIL_SENSOR_UPDATED_YACC = 2 ; # [doc = "The value in the zacc field has been updated"] const HIL_SENSOR_UPDATED_ZACC = 4 ; # [doc = "The value in the xgyro field has been updated"] const HIL_SENSOR_UPDATED_XGYRO = 8 ; # [doc = "The value in the ygyro field has been updated"] const HIL_SENSOR_UPDATED_YGYRO = 16 ; # [doc = "The value in the zgyro field has been updated"] const HIL_SENSOR_UPDATED_ZGYRO = 32 ; # [doc = "The value in the xmag field has been updated"] const HIL_SENSOR_UPDATED_XMAG = 64 ; # [doc = "The value in the ymag field has been updated"] const HIL_SENSOR_UPDATED_YMAG = 128 ; # [doc = "The value in the zmag field has been updated"] const HIL_SENSOR_UPDATED_ZMAG = 256 ; # [doc = "The value in the abs_pressure field has been updated"] const HIL_SENSOR_UPDATED_ABS_PRESSURE = 512 ; # [doc = "The value in the diff_pressure field has been updated"] const HIL_SENSOR_UPDATED_DIFF_PRESSURE = 1024 ; # [doc = "The value in the pressure_alt field has been updated"] const HIL_SENSOR_UPDATED_PRESSURE_ALT = 2048 ; # [doc = "The value in the temperature field has been updated"] const HIL_SENSOR_UPDATED_TEMPERATURE = 4096 ; # [doc = "Full reset of attitude/position/velocities/etc was performed in sim (Bit 31)."] const HIL_SENSOR_UPDATED_RESET = 2147483648 ; } }
1148impl HilSensorUpdatedFlags {
1149 pub const DEFAULT: Self = Self::HIL_SENSOR_UPDATED_XACC;
1150}
1151impl Default for HilSensorUpdatedFlags {
1152 fn default() -> Self {
1153 Self::DEFAULT
1154 }
1155}
1156bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report failure cases over the high latency telemetry."] pub struct HlFailureFlag : u16 { # [doc = "GPS failure."] const HL_FAILURE_FLAG_GPS = 1 ; # [doc = "Differential pressure sensor failure."] const HL_FAILURE_FLAG_DIFFERENTIAL_PRESSURE = 2 ; # [doc = "Absolute pressure sensor failure."] const HL_FAILURE_FLAG_ABSOLUTE_PRESSURE = 4 ; # [doc = "Accelerometer sensor failure."] const HL_FAILURE_FLAG_3D_ACCEL = 8 ; # [doc = "Gyroscope sensor failure."] const HL_FAILURE_FLAG_3D_GYRO = 16 ; # [doc = "Magnetometer sensor failure."] const HL_FAILURE_FLAG_3D_MAG = 32 ; # [doc = "Terrain subsystem failure."] const HL_FAILURE_FLAG_TERRAIN = 64 ; # [doc = "Battery failure/critical low battery."] const HL_FAILURE_FLAG_BATTERY = 128 ; # [doc = "RC receiver failure/no RC connection."] const HL_FAILURE_FLAG_RC_RECEIVER = 256 ; # [doc = "Offboard link failure."] const HL_FAILURE_FLAG_OFFBOARD_LINK = 512 ; # [doc = "Engine failure."] const HL_FAILURE_FLAG_ENGINE = 1024 ; # [doc = "Geofence violation."] const HL_FAILURE_FLAG_GEOFENCE = 2048 ; # [doc = "Estimator failure, for example measurement rejection or large variances."] const HL_FAILURE_FLAG_ESTIMATOR = 4096 ; # [doc = "Mission failure."] const HL_FAILURE_FLAG_MISSION = 8192 ; } }
1157impl HlFailureFlag {
1158 pub const DEFAULT: Self = Self::HL_FAILURE_FLAG_GPS;
1159}
1160impl Default for HlFailureFlag {
1161 fn default() -> Self {
1162 Self::DEFAULT
1163 }
1164}
1165bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Illuminator module error flags (bitmap, 0 means no error)"] pub struct IlluminatorErrorFlags : u32 { # [doc = "Illuminator thermal throttling error."] const ILLUMINATOR_ERROR_FLAGS_THERMAL_THROTTLING = 1 ; # [doc = "Illuminator over temperature shutdown error."] const ILLUMINATOR_ERROR_FLAGS_OVER_TEMPERATURE_SHUTDOWN = 2 ; # [doc = "Illuminator thermistor failure."] const ILLUMINATOR_ERROR_FLAGS_THERMISTOR_FAILURE = 4 ; } }
1166impl IlluminatorErrorFlags {
1167 pub const DEFAULT: Self = Self::ILLUMINATOR_ERROR_FLAGS_THERMAL_THROTTLING;
1168}
1169impl Default for IlluminatorErrorFlags {
1170 fn default() -> Self {
1171 Self::DEFAULT
1172 }
1173}
1174#[cfg_attr(feature = "ts", derive(TS))]
1175#[cfg_attr(feature = "ts", ts(export))]
1176#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1177#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1178#[cfg_attr(feature = "serde", serde(tag = "type"))]
1179#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1180#[repr(u32)]
1181#[doc = "Modes of illuminator"]
1182pub enum IlluminatorMode {
1183 #[doc = "Illuminator mode is not specified/unknown"]
1184 ILLUMINATOR_MODE_UNKNOWN = 0,
1185 #[doc = "Illuminator behavior is controlled by MAV_CMD_DO_ILLUMINATOR_CONFIGURE settings"]
1186 ILLUMINATOR_MODE_INTERNAL_CONTROL = 1,
1187 #[doc = "Illuminator behavior is controlled by external factors: e.g. an external hardware signal"]
1188 ILLUMINATOR_MODE_EXTERNAL_SYNC = 2,
1189}
1190impl IlluminatorMode {
1191 pub const DEFAULT: Self = Self::ILLUMINATOR_MODE_UNKNOWN;
1192}
1193impl Default for IlluminatorMode {
1194 fn default() -> Self {
1195 Self::DEFAULT
1196 }
1197}
1198#[cfg_attr(feature = "ts", derive(TS))]
1199#[cfg_attr(feature = "ts", ts(export))]
1200#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1201#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1202#[cfg_attr(feature = "serde", serde(tag = "type"))]
1203#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1204#[repr(u32)]
1205#[doc = "Type of landing target"]
1206pub enum LandingTargetType {
1207 #[doc = "Landing target signaled by light beacon (ex: IR-LOCK)"]
1208 LANDING_TARGET_TYPE_LIGHT_BEACON = 0,
1209 #[doc = "Landing target signaled by radio beacon (ex: ILS, NDB)"]
1210 LANDING_TARGET_TYPE_RADIO_BEACON = 1,
1211 #[doc = "Landing target represented by a fiducial marker (ex: ARTag)"]
1212 LANDING_TARGET_TYPE_VISION_FIDUCIAL = 2,
1213 #[doc = "Landing target represented by a pre-defined visual shape/feature (ex: X-marker, H-marker, square)"]
1214 LANDING_TARGET_TYPE_VISION_OTHER = 3,
1215}
1216impl LandingTargetType {
1217 pub const DEFAULT: Self = Self::LANDING_TARGET_TYPE_LIGHT_BEACON;
1218}
1219impl Default for LandingTargetType {
1220 fn default() -> Self {
1221 Self::DEFAULT
1222 }
1223}
1224#[cfg_attr(feature = "ts", derive(TS))]
1225#[cfg_attr(feature = "ts", ts(export))]
1226#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1227#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1228#[cfg_attr(feature = "serde", serde(tag = "type"))]
1229#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1230#[repr(u32)]
1231pub enum MagCalStatus {
1232 MAG_CAL_NOT_STARTED = 0,
1233 MAG_CAL_WAITING_TO_START = 1,
1234 MAG_CAL_RUNNING_STEP_ONE = 2,
1235 MAG_CAL_RUNNING_STEP_TWO = 3,
1236 MAG_CAL_SUCCESS = 4,
1237 MAG_CAL_FAILED = 5,
1238 MAG_CAL_BAD_ORIENTATION = 6,
1239 MAG_CAL_BAD_RADIUS = 7,
1240}
1241impl MagCalStatus {
1242 pub const DEFAULT: Self = Self::MAG_CAL_NOT_STARTED;
1243}
1244impl Default for MagCalStatus {
1245 fn default() -> Self {
1246 Self::DEFAULT
1247 }
1248}
1249#[cfg_attr(feature = "ts", derive(TS))]
1250#[cfg_attr(feature = "ts", ts(export))]
1251#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1252#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1253#[cfg_attr(feature = "serde", serde(tag = "type"))]
1254#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1255#[repr(u32)]
1256pub enum MavArmAuthDeniedReason {
1257 #[doc = "Not a specific reason"]
1258 MAV_ARM_AUTH_DENIED_REASON_GENERIC = 0,
1259 #[doc = "Authorizer will send the error as string to GCS"]
1260 MAV_ARM_AUTH_DENIED_REASON_NONE = 1,
1261 #[doc = "At least one waypoint have a invalid value"]
1262 MAV_ARM_AUTH_DENIED_REASON_INVALID_WAYPOINT = 2,
1263 #[doc = "Timeout in the authorizer process(in case it depends on network)"]
1264 MAV_ARM_AUTH_DENIED_REASON_TIMEOUT = 3,
1265 #[doc = "Airspace of the mission in use by another vehicle, second result parameter can have the waypoint id that caused it to be denied."]
1266 MAV_ARM_AUTH_DENIED_REASON_AIRSPACE_IN_USE = 4,
1267 #[doc = "Weather is not good to fly"]
1268 MAV_ARM_AUTH_DENIED_REASON_BAD_WEATHER = 5,
1269}
1270impl MavArmAuthDeniedReason {
1271 pub const DEFAULT: Self = Self::MAV_ARM_AUTH_DENIED_REASON_GENERIC;
1272}
1273impl Default for MavArmAuthDeniedReason {
1274 fn default() -> Self {
1275 Self::DEFAULT
1276 }
1277}
1278#[cfg_attr(feature = "ts", derive(TS))]
1279#[cfg_attr(feature = "ts", ts(export))]
1280#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1281#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1282#[cfg_attr(feature = "serde", serde(tag = "type"))]
1283#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1284#[repr(u32)]
1285#[doc = "Micro air vehicle / autopilot classes. This identifies the individual model."]
1286pub enum MavAutopilot {
1287 #[doc = "Generic autopilot, full support for everything"]
1288 MAV_AUTOPILOT_GENERIC = 0,
1289 #[doc = "Reserved for future use."]
1290 MAV_AUTOPILOT_RESERVED = 1,
1291 #[doc = "SLUGS autopilot, <http://slugsuav.soe.ucsc.edu>"]
1292 MAV_AUTOPILOT_SLUGS = 2,
1293 #[doc = "ArduPilot - Plane/Copter/Rover/Sub/Tracker, <https://ardupilot.org>"]
1294 MAV_AUTOPILOT_ARDUPILOTMEGA = 3,
1295 #[doc = "OpenPilot, <http://openpilot.org>"]
1296 MAV_AUTOPILOT_OPENPILOT = 4,
1297 #[doc = "Generic autopilot only supporting simple waypoints"]
1298 MAV_AUTOPILOT_GENERIC_WAYPOINTS_ONLY = 5,
1299 #[doc = "Generic autopilot supporting waypoints and other simple navigation commands"]
1300 MAV_AUTOPILOT_GENERIC_WAYPOINTS_AND_SIMPLE_NAVIGATION_ONLY = 6,
1301 #[doc = "Generic autopilot supporting the full mission command set"]
1302 MAV_AUTOPILOT_GENERIC_MISSION_FULL = 7,
1303 #[doc = "No valid autopilot, e.g. a GCS or other MAVLink component"]
1304 MAV_AUTOPILOT_INVALID = 8,
1305 #[doc = "PPZ UAV - <http://nongnu.org/paparazzi>"]
1306 MAV_AUTOPILOT_PPZ = 9,
1307 #[doc = "UAV Dev Board"]
1308 MAV_AUTOPILOT_UDB = 10,
1309 #[doc = "FlexiPilot"]
1310 MAV_AUTOPILOT_FP = 11,
1311 #[doc = "PX4 Autopilot - <http://px4.io/>"]
1312 MAV_AUTOPILOT_PX4 = 12,
1313 #[doc = "SMACCMPilot - <http://smaccmpilot.org>"]
1314 MAV_AUTOPILOT_SMACCMPILOT = 13,
1315 #[doc = "AutoQuad -- <http://autoquad.org>"]
1316 MAV_AUTOPILOT_AUTOQUAD = 14,
1317 #[doc = "Armazila -- <http://armazila.com>"]
1318 MAV_AUTOPILOT_ARMAZILA = 15,
1319 #[doc = "Aerob -- <http://aerob.ru>"]
1320 MAV_AUTOPILOT_AEROB = 16,
1321 #[doc = "ASLUAV autopilot -- <http://www.asl.ethz.ch>"]
1322 MAV_AUTOPILOT_ASLUAV = 17,
1323 #[doc = "SmartAP Autopilot - <http://sky-drones.com>"]
1324 MAV_AUTOPILOT_SMARTAP = 18,
1325 #[doc = "AirRails - <http://uaventure.com>"]
1326 MAV_AUTOPILOT_AIRRAILS = 19,
1327 #[doc = "Fusion Reflex - <https://fusion.engineering>"]
1328 MAV_AUTOPILOT_REFLEX = 20,
1329}
1330impl MavAutopilot {
1331 pub const DEFAULT: Self = Self::MAV_AUTOPILOT_GENERIC;
1332}
1333impl Default for MavAutopilot {
1334 fn default() -> Self {
1335 Self::DEFAULT
1336 }
1337}
1338#[cfg_attr(feature = "ts", derive(TS))]
1339#[cfg_attr(feature = "ts", ts(export))]
1340#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1341#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1342#[cfg_attr(feature = "serde", serde(tag = "type"))]
1343#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1344#[repr(u32)]
1345pub enum MavAvssCommandFailureReason {
1346 #[doc = "AVSS defined command failure reason. PRS not steady."]
1347 PRS_NOT_STEADY = 1,
1348 #[doc = "AVSS defined command failure reason. PRS DTM not armed."]
1349 PRS_DTM_NOT_ARMED = 2,
1350 #[doc = "AVSS defined command failure reason. PRS OTM not armed."]
1351 PRS_OTM_NOT_ARMED = 3,
1352}
1353impl MavAvssCommandFailureReason {
1354 pub const DEFAULT: Self = Self::PRS_NOT_STEADY;
1355}
1356impl Default for MavAvssCommandFailureReason {
1357 fn default() -> Self {
1358 Self::DEFAULT
1359 }
1360}
1361#[cfg_attr(feature = "ts", derive(TS))]
1362#[cfg_attr(feature = "ts", ts(export))]
1363#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1364#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1365#[cfg_attr(feature = "serde", serde(tag = "type"))]
1366#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1367#[repr(u32)]
1368#[doc = "Enumeration for battery charge states."]
1369pub enum MavBatteryChargeState {
1370 #[doc = "Low battery state is not provided"]
1371 MAV_BATTERY_CHARGE_STATE_UNDEFINED = 0,
1372 #[doc = "Battery is not in low state. Normal operation."]
1373 MAV_BATTERY_CHARGE_STATE_OK = 1,
1374 #[doc = "Battery state is low, warn and monitor close."]
1375 MAV_BATTERY_CHARGE_STATE_LOW = 2,
1376 #[doc = "Battery state is critical, return or abort immediately."]
1377 MAV_BATTERY_CHARGE_STATE_CRITICAL = 3,
1378 #[doc = "Battery state is too low for ordinary abort sequence. Perform fastest possible emergency stop to prevent damage."]
1379 MAV_BATTERY_CHARGE_STATE_EMERGENCY = 4,
1380 #[doc = "Battery failed, damage unavoidable. Possible causes (faults) are listed in MAV_BATTERY_FAULT."]
1381 MAV_BATTERY_CHARGE_STATE_FAILED = 5,
1382 #[doc = "Battery is diagnosed to be defective or an error occurred, usage is discouraged / prohibited. Possible causes (faults) are listed in MAV_BATTERY_FAULT."]
1383 MAV_BATTERY_CHARGE_STATE_UNHEALTHY = 6,
1384 #[doc = "Battery is charging."]
1385 MAV_BATTERY_CHARGE_STATE_CHARGING = 7,
1386}
1387impl MavBatteryChargeState {
1388 pub const DEFAULT: Self = Self::MAV_BATTERY_CHARGE_STATE_UNDEFINED;
1389}
1390impl Default for MavBatteryChargeState {
1391 fn default() -> Self {
1392 Self::DEFAULT
1393 }
1394}
1395bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Smart battery supply status/fault flags (bitmask) for health indication. The battery must also report either MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY if any of these are set."] pub struct MavBatteryFault : u32 { # [doc = "Battery has deep discharged."] const MAV_BATTERY_FAULT_DEEP_DISCHARGE = 1 ; # [doc = "Voltage spikes."] const MAV_BATTERY_FAULT_SPIKES = 2 ; # [doc = "One or more cells have failed. Battery should also report MAV_BATTERY_CHARGE_STATE_FAILE (and should not be used)."] const MAV_BATTERY_FAULT_CELL_FAIL = 4 ; # [doc = "Over-current fault."] const MAV_BATTERY_FAULT_OVER_CURRENT = 8 ; # [doc = "Over-temperature fault."] const MAV_BATTERY_FAULT_OVER_TEMPERATURE = 16 ; # [doc = "Under-temperature fault."] const MAV_BATTERY_FAULT_UNDER_TEMPERATURE = 32 ; # [doc = "Vehicle voltage is not compatible with this battery (batteries on same power rail should have similar voltage)."] const MAV_BATTERY_FAULT_INCOMPATIBLE_VOLTAGE = 64 ; # [doc = "Battery firmware is not compatible with current autopilot firmware."] const MAV_BATTERY_FAULT_INCOMPATIBLE_FIRMWARE = 128 ; # [doc = "Battery is not compatible due to cell configuration (e.g. 5s1p when vehicle requires 6s)."] const BATTERY_FAULT_INCOMPATIBLE_CELLS_CONFIGURATION = 256 ; } }
1396impl MavBatteryFault {
1397 pub const DEFAULT: Self = Self::MAV_BATTERY_FAULT_DEEP_DISCHARGE;
1398}
1399impl Default for MavBatteryFault {
1400 fn default() -> Self {
1401 Self::DEFAULT
1402 }
1403}
1404#[cfg_attr(feature = "ts", derive(TS))]
1405#[cfg_attr(feature = "ts", ts(export))]
1406#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1407#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1408#[cfg_attr(feature = "serde", serde(tag = "type"))]
1409#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1410#[repr(u32)]
1411#[doc = "Enumeration of battery functions"]
1412pub enum MavBatteryFunction {
1413 #[doc = "Battery function is unknown"]
1414 MAV_BATTERY_FUNCTION_UNKNOWN = 0,
1415 #[doc = "Battery supports all flight systems"]
1416 MAV_BATTERY_FUNCTION_ALL = 1,
1417 #[doc = "Battery for the propulsion system"]
1418 MAV_BATTERY_FUNCTION_PROPULSION = 2,
1419 #[doc = "Avionics battery"]
1420 MAV_BATTERY_FUNCTION_AVIONICS = 3,
1421 #[doc = "Payload battery"]
1422 MAV_BATTERY_FUNCTION_PAYLOAD = 4,
1423}
1424impl MavBatteryFunction {
1425 pub const DEFAULT: Self = Self::MAV_BATTERY_FUNCTION_UNKNOWN;
1426}
1427impl Default for MavBatteryFunction {
1428 fn default() -> Self {
1429 Self::DEFAULT
1430 }
1431}
1432#[cfg_attr(feature = "ts", derive(TS))]
1433#[cfg_attr(feature = "ts", ts(export))]
1434#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1435#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1436#[cfg_attr(feature = "serde", serde(tag = "type"))]
1437#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1438#[repr(u32)]
1439#[doc = "Battery mode. Note, the normal operation mode (i.e. when flying) should be reported as MAV_BATTERY_MODE_UNKNOWN to allow message trimming in normal flight."]
1440pub enum MavBatteryMode {
1441 #[doc = "Battery mode not supported/unknown battery mode/normal operation."]
1442 MAV_BATTERY_MODE_UNKNOWN = 0,
1443 #[doc = "Battery is auto discharging (towards storage level)."]
1444 MAV_BATTERY_MODE_AUTO_DISCHARGING = 1,
1445 #[doc = "Battery in hot-swap mode (current limited to prevent spikes that might damage sensitive electrical circuits)."]
1446 MAV_BATTERY_MODE_HOT_SWAP = 2,
1447}
1448impl MavBatteryMode {
1449 pub const DEFAULT: Self = Self::MAV_BATTERY_MODE_UNKNOWN;
1450}
1451impl Default for MavBatteryMode {
1452 fn default() -> Self {
1453 Self::DEFAULT
1454 }
1455}
1456#[cfg_attr(feature = "ts", derive(TS))]
1457#[cfg_attr(feature = "ts", ts(export))]
1458#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1459#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1460#[cfg_attr(feature = "serde", serde(tag = "type"))]
1461#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1462#[repr(u32)]
1463#[doc = "Enumeration of battery types"]
1464pub enum MavBatteryType {
1465 #[doc = "Not specified."]
1466 MAV_BATTERY_TYPE_UNKNOWN = 0,
1467 #[doc = "Lithium polymer battery"]
1468 MAV_BATTERY_TYPE_LIPO = 1,
1469 #[doc = "Lithium-iron-phosphate battery"]
1470 MAV_BATTERY_TYPE_LIFE = 2,
1471 #[doc = "Lithium-ION battery"]
1472 MAV_BATTERY_TYPE_LION = 3,
1473 #[doc = "Nickel metal hydride battery"]
1474 MAV_BATTERY_TYPE_NIMH = 4,
1475}
1476impl MavBatteryType {
1477 pub const DEFAULT: Self = Self::MAV_BATTERY_TYPE_UNKNOWN;
1478}
1479impl Default for MavBatteryType {
1480 fn default() -> Self {
1481 Self::DEFAULT
1482 }
1483}
1484#[cfg_attr(feature = "ts", derive(TS))]
1485#[cfg_attr(feature = "ts", ts(export))]
1486#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1487#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1488#[cfg_attr(feature = "serde", serde(tag = "type"))]
1489#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1490#[repr(u32)]
1491#[doc = "Commands to be executed by the MAV. They can be executed on user request, or as part of a mission script. If the action is used in a mission, the parameter mapping to the waypoint/mission message is as follows: Param 1, Param 2, Param 3, Param 4, X: Param 5, Y:Param 6, Z:Param 7. This command list is similar what ARINC 424 is for commercial aircraft: A data format how to interpret waypoint/mission data. NaN and INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current yaw or latitude rather than a specific value). See <https://mavlink.io/en/guide/xml_schema.html#MAV_CMD> for information about the structure of the MAV_CMD entries"]
1492pub enum MavCmd {
1493 #[doc = "Navigate to waypoint. This is intended for use in missions (for guided commands outside of missions use MAV_CMD_DO_REPOSITION)."]
1494 MAV_CMD_NAV_WAYPOINT = 16,
1495 #[doc = "Loiter around this waypoint an unlimited amount of time"]
1496 MAV_CMD_NAV_LOITER_UNLIM = 17,
1497 #[doc = "Loiter around this waypoint for X turns"]
1498 MAV_CMD_NAV_LOITER_TURNS = 18,
1499 #[doc = "Loiter at the specified latitude, longitude and altitude for a certain amount of time. Multicopter vehicles stop at the point (within a vehicle-specific acceptance radius). Forward-only moving vehicles (e.g. fixed-wing) circle the point with the specified radius/direction. If the Heading Required parameter (2) is non-zero forward moving aircraft will only leave the loiter circle once heading towards the next waypoint."]
1500 MAV_CMD_NAV_LOITER_TIME = 19,
1501 #[doc = "Return to launch location"]
1502 MAV_CMD_NAV_RETURN_TO_LAUNCH = 20,
1503 #[doc = "Land at location."]
1504 MAV_CMD_NAV_LAND = 21,
1505 #[doc = "Takeoff from ground / hand. Vehicles that support multiple takeoff modes (e.g. VTOL quadplane) should take off using the currently configured mode."]
1506 MAV_CMD_NAV_TAKEOFF = 22,
1507 #[doc = "Land at local position (local frame only)"]
1508 MAV_CMD_NAV_LAND_LOCAL = 23,
1509 #[doc = "Takeoff from local position (local frame only)"]
1510 MAV_CMD_NAV_TAKEOFF_LOCAL = 24,
1511 #[doc = "Vehicle following, i.e. this waypoint represents the position of a moving vehicle"]
1512 MAV_CMD_NAV_FOLLOW = 25,
1513 #[doc = "Continue on the current course and climb/descend to specified altitude. When the altitude is reached continue to the next command (i.e., don't proceed to the next command until the desired altitude is reached."]
1514 MAV_CMD_NAV_CONTINUE_AND_CHANGE_ALT = 30,
1515 #[doc = "Begin loiter at the specified Latitude and Longitude. If Lat=Lon=0, then loiter at the current position. Don't consider the navigation command complete (don't leave loiter) until the altitude has been reached. Additionally, if the Heading Required parameter is non-zero the aircraft will not leave the loiter until heading toward the next waypoint."]
1516 MAV_CMD_NAV_LOITER_TO_ALT = 31,
1517 #[doc = "Begin following a target"]
1518 MAV_CMD_DO_FOLLOW = 32,
1519 #[doc = "Reposition the MAV after a follow target command has been sent"]
1520 MAV_CMD_DO_FOLLOW_REPOSITION = 33,
1521 #[doc = "Start orbiting on the circumference of a circle defined by the parameters. Setting values to NaN/INT32_MAX (as appropriate) results in using defaults."]
1522 MAV_CMD_DO_ORBIT = 34,
1523 #[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
1524 #[doc = "Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras."]
1525 MAV_CMD_NAV_ROI = 80,
1526 #[doc = "Control autonomous path planning on the MAV."]
1527 MAV_CMD_NAV_PATHPLANNING = 81,
1528 #[doc = "Navigate to waypoint using a spline path."]
1529 MAV_CMD_NAV_SPLINE_WAYPOINT = 82,
1530 #[doc = "Takeoff from ground using VTOL mode, and transition to forward flight with specified heading. The command should be ignored by vehicles that dont support both VTOL and fixed-wing flight (multicopters, boats,etc.)."]
1531 MAV_CMD_NAV_VTOL_TAKEOFF = 84,
1532 #[doc = "Land using VTOL mode"]
1533 MAV_CMD_NAV_VTOL_LAND = 85,
1534 #[doc = "hand control over to an external controller"]
1535 MAV_CMD_NAV_GUIDED_ENABLE = 92,
1536 #[doc = "Delay the next navigation command a number of seconds or until a specified time"]
1537 MAV_CMD_NAV_DELAY = 93,
1538 #[doc = "Descend and place payload. Vehicle moves to specified location, descends until it detects a hanging payload has reached the ground, and then releases the payload. If ground is not detected before the reaching the maximum descent value (param1), the command will complete without releasing the payload."]
1539 MAV_CMD_NAV_PAYLOAD_PLACE = 94,
1540 #[doc = "NOP - This command is only used to mark the upper limit of the NAV/ACTION commands in the enumeration"]
1541 MAV_CMD_NAV_LAST = 95,
1542 #[doc = "Delay mission state machine."]
1543 MAV_CMD_CONDITION_DELAY = 112,
1544 #[doc = "Ascend/descend to target altitude at specified rate. Delay mission state machine until desired altitude reached."]
1545 MAV_CMD_CONDITION_CHANGE_ALT = 113,
1546 #[doc = "Delay mission state machine until within desired distance of next NAV point."]
1547 MAV_CMD_CONDITION_DISTANCE = 114,
1548 #[doc = "Reach a certain target angle."]
1549 MAV_CMD_CONDITION_YAW = 115,
1550 #[doc = "NOP - This command is only used to mark the upper limit of the CONDITION commands in the enumeration"]
1551 MAV_CMD_CONDITION_LAST = 159,
1552 #[doc = "Set system mode."]
1553 MAV_CMD_DO_SET_MODE = 176,
1554 #[doc = "Jump to the desired command in the mission list. Repeat this action only the specified number of times"]
1555 MAV_CMD_DO_JUMP = 177,
1556 #[doc = "Change speed and/or throttle set points. The value persists until it is overridden or there is a mode change"]
1557 MAV_CMD_DO_CHANGE_SPEED = 178,
1558 #[doc = "Sets the home position to either to the current position or a specified position. The home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this command). Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
1559 MAV_CMD_DO_SET_HOME = 179,
1560 #[deprecated = " See `PARAM_SET` (Deprecated since 2024-04)"]
1561 #[doc = "Set a system parameter. Caution! Use of this command requires knowledge of the numeric enumeration value of the parameter."]
1562 MAV_CMD_DO_SET_PARAMETER = 180,
1563 #[doc = "Set a relay to a condition."]
1564 MAV_CMD_DO_SET_RELAY = 181,
1565 #[doc = "Cycle a relay on and off for a desired number of cycles with a desired period."]
1566 MAV_CMD_DO_REPEAT_RELAY = 182,
1567 #[doc = "Set a servo to a desired PWM value."]
1568 MAV_CMD_DO_SET_SERVO = 183,
1569 #[doc = "Cycle a between its nominal setting and a desired PWM for a desired number of cycles with a desired period."]
1570 MAV_CMD_DO_REPEAT_SERVO = 184,
1571 #[doc = "0.5); the ACK should be either MAV_RESULT_FAILED or MAV_RESULT_UNSUPPORTED."]
1572 MAV_CMD_DO_FLIGHTTERMINATION = 185,
1573 #[doc = "Change altitude set point."]
1574 MAV_CMD_DO_CHANGE_ALTITUDE = 186,
1575 #[doc = "Sets actuators (e.g. servos) to a desired value. The actuator numbers are mapped to specific outputs (e.g. on any MAIN or AUX PWM or UAVCAN) using a flight-stack specific mechanism (i.e. a parameter)."]
1576 MAV_CMD_DO_SET_ACTUATOR = 187,
1577 #[doc = "Mission item to specify the start of a failsafe/landing return-path segment (the end of the segment is the next MAV_CMD_DO_LAND_START item). A vehicle that is using missions for landing (e.g. in a return mode) will join the mission on the closest path of the return-path segment (instead of MAV_CMD_DO_LAND_START or the nearest waypoint). The main use case is to minimize the failsafe flight path in corridor missions, where the inbound/outbound paths are constrained (by geofences) to the same particular path. The MAV_CMD_NAV_RETURN_PATH_START would be placed at the start of the return path. If a failsafe occurs on the outbound path the vehicle will move to the nearest point on the return path (which is parallel for this kind of mission), effectively turning round and following the shortest path to landing. If a failsafe occurs on the inbound path the vehicle is already on the return segment and will continue to landing. The Latitude/Longitude/Altitude are optional, and may be set to 0 if not needed. If specified, the item defines the waypoint at which the return segment starts. If sent using as a command, the vehicle will perform a mission landing (using the land segment if defined) or reject the command if mission landings are not supported, or no mission landing is defined. When used as a command any position information in the command is ignored."]
1578 MAV_CMD_DO_RETURN_PATH_START = 188,
1579 #[doc = "Mission item to mark the start of a mission landing pattern, or a command to land with a mission landing pattern. When used in a mission, this is a marker for the start of a sequence of mission items that represent a landing pattern. It should be followed by a navigation item that defines the first waypoint of the landing sequence. The start marker positional params are used only for selecting what landing pattern to use if several are defined in the mission (the selected pattern will be the one with the marker position that is closest to the vehicle when a landing is commanded). If the marker item position has zero-values for latitude, longitude, and altitude, then landing pattern selection is instead based on the position of the first waypoint in the landing sequence. \t When sent as a command it triggers a landing using a mission landing pattern. \t The location parameters are not used in this case, and should be set to 0."]
1580 MAV_CMD_DO_LAND_START = 189,
1581 #[doc = "Mission command to perform a landing from a rally point."]
1582 MAV_CMD_DO_RALLY_LAND = 190,
1583 #[doc = "Mission command to safely abort an autonomous landing."]
1584 MAV_CMD_DO_GO_AROUND = 191,
1585 #[doc = "Reposition the vehicle to a specific WGS84 global position. This command is intended for guided commands (for missions use MAV_CMD_NAV_WAYPOINT instead)."]
1586 MAV_CMD_DO_REPOSITION = 192,
1587 #[doc = "If in a GPS controlled position mode, hold the current position or continue."]
1588 MAV_CMD_DO_PAUSE_CONTINUE = 193,
1589 #[doc = "Set moving direction to forward or reverse."]
1590 MAV_CMD_DO_SET_REVERSE = 194,
1591 #[doc = "Sets the region of interest (ROI) to a location. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal is not to react to this message."]
1592 MAV_CMD_DO_SET_ROI_LOCATION = 195,
1593 #[doc = "Sets the region of interest (ROI) to be toward next waypoint, with optional pitch/roll/yaw offset. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message."]
1594 MAV_CMD_DO_SET_ROI_WPNEXT_OFFSET = 196,
1595 #[doc = "Cancels any previous ROI command returning the vehicle/sensors to default flight characteristics. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message. After this command the gimbal manager should go back to manual input if available, and otherwise assume a neutral position."]
1596 MAV_CMD_DO_SET_ROI_NONE = 197,
1597 #[doc = "Mount tracks system with specified system ID. Determination of target vehicle position may be done with GLOBAL_POSITION_INT or any other means. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message."]
1598 MAV_CMD_DO_SET_ROI_SYSID = 198,
1599 #[doc = "Control onboard camera system."]
1600 MAV_CMD_DO_CONTROL_VIDEO = 200,
1601 #[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
1602 #[doc = "Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras."]
1603 MAV_CMD_DO_SET_ROI = 201,
1604 #[doc = "Configure digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see <https://mavlink.io/en/services/camera_def.html> )."]
1605 MAV_CMD_DO_DIGICAM_CONFIGURE = 202,
1606 #[doc = "Control digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see <https://mavlink.io/en/services/camera_def.html> )."]
1607 MAV_CMD_DO_DIGICAM_CONTROL = 203,
1608 #[deprecated = "This message has been superseded by MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE` (Deprecated since 2020-01)"]
1609 #[doc = "Mission command to configure a camera or antenna mount"]
1610 MAV_CMD_DO_MOUNT_CONFIGURE = 204,
1611 #[deprecated = "This message is ambiguous and inconsistent. It has been superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW and `MAV_CMD_DO_SET_ROI_*` variants. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
1612 #[doc = "Mission command to control a camera or antenna mount"]
1613 MAV_CMD_DO_MOUNT_CONTROL = 205,
1614 #[doc = "Mission command to set camera trigger distance for this flight. The camera is triggered each time this distance is exceeded. This command can also be used to set the shutter integration time for the camera."]
1615 MAV_CMD_DO_SET_CAM_TRIGG_DIST = 206,
1616 #[doc = "Enable the geofence. This can be used in a mission or via the command protocol. The persistence/lifetime of the setting is undefined. Depending on flight stack implementation it may persist until superseded, or it may revert to a system default at the end of a mission. Flight stacks typically reset the setting to system defaults on reboot."]
1617 MAV_CMD_DO_FENCE_ENABLE = 207,
1618 #[doc = "Mission item/command to release a parachute or enable/disable auto release."]
1619 MAV_CMD_DO_PARACHUTE = 208,
1620 #[doc = "Command to perform motor test."]
1621 MAV_CMD_DO_MOTOR_TEST = 209,
1622 #[doc = "Change to/from inverted flight."]
1623 MAV_CMD_DO_INVERTED_FLIGHT = 210,
1624 #[doc = "Mission command to operate a gripper."]
1625 MAV_CMD_DO_GRIPPER = 211,
1626 #[doc = "Enable/disable autotune."]
1627 MAV_CMD_DO_AUTOTUNE_ENABLE = 212,
1628 #[doc = "Sets a desired vehicle turn angle and speed change."]
1629 MAV_CMD_NAV_SET_YAW_SPEED = 213,
1630 #[doc = "Mission command to set camera trigger interval for this flight. If triggering is enabled, the camera is triggered each time this interval expires. This command can also be used to set the shutter integration time for the camera."]
1631 MAV_CMD_DO_SET_CAM_TRIGG_INTERVAL = 214,
1632 #[deprecated = " See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
1633 #[doc = "Mission command to control a camera or antenna mount, using a quaternion as reference."]
1634 MAV_CMD_DO_MOUNT_CONTROL_QUAT = 220,
1635 #[doc = "set id of master controller"]
1636 MAV_CMD_DO_GUIDED_MASTER = 221,
1637 #[doc = "Set limits for external control"]
1638 MAV_CMD_DO_GUIDED_LIMITS = 222,
1639 #[doc = "Control vehicle engine. This is interpreted by the vehicles engine controller to change the target engine state. It is intended for vehicles with internal combustion engines"]
1640 MAV_CMD_DO_ENGINE_CONTROL = 223,
1641 #[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. \t Note that mission jump repeat counters are not reset unless param2 is set (see MAV_CMD_DO_JUMP param2). This command may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this command must not trigger a switch to mission mode. The mission may be \"reset\" using param2. Resetting sets jump counters to initial values (to reset counters without changing the current mission item set the param1 to `-1`). Resetting also explicitly changes a mission state of MISSION_STATE_COMPLETE to MISSION_STATE_PAUSED or MISSION_STATE_ACTIVE, potentially allowing it to resume when it is (next) in a mission mode. \t The command will ACK with MAV_RESULT_FAILED if the sequence number is out of range (including if there is no mission item)."]
1642 MAV_CMD_DO_SET_MISSION_CURRENT = 224,
1643 #[doc = "NOP - This command is only used to mark the upper limit of the DO commands in the enumeration"]
1644 MAV_CMD_DO_LAST = 240,
1645 #[doc = "Trigger calibration. This command will be only accepted if in pre-flight mode. Except for Temperature Calibration, only one sensor should be set in a single message and all others should be zero."]
1646 MAV_CMD_PREFLIGHT_CALIBRATION = 241,
1647 #[doc = "Set sensor offsets. This command will be only accepted if in pre-flight mode."]
1648 MAV_CMD_PREFLIGHT_SET_SENSOR_OFFSETS = 242,
1649 #[doc = "Trigger UAVCAN configuration (actuator ID assignment and direction mapping). Note that this maps to the legacy UAVCAN v0 function UAVCAN_ENUMERATE, which is intended to be executed just once during initial vehicle configuration (it is not a normal pre-flight command and has been poorly named)."]
1650 MAV_CMD_PREFLIGHT_UAVCAN = 243,
1651 #[doc = "Request storage of different parameter values and logs. This command will be only accepted if in pre-flight mode."]
1652 MAV_CMD_PREFLIGHT_STORAGE = 245,
1653 #[doc = "Request the reboot or shutdown of system components."]
1654 MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN = 246,
1655 #[doc = "Override current mission with command to pause mission, pause mission and move to position, continue/resume mission. When param 1 indicates that the mission is paused (MAV_GOTO_DO_HOLD), param 2 defines whether it holds in place or moves to another position."]
1656 MAV_CMD_OVERRIDE_GOTO = 252,
1657 #[doc = "Mission command to set a Camera Auto Mount Pivoting Oblique Survey (Replaces CAM_TRIGG_DIST for this purpose). The camera is triggered each time this distance is exceeded, then the mount moves to the next position. Params 4~6 set-up the angle limits and number of positions for oblique survey, where mount-enabled vehicles automatically roll the camera between shots to emulate an oblique camera setup (providing an increased HFOV). This command can also be used to set the shutter integration time for the camera."]
1658 MAV_CMD_OBLIQUE_SURVEY = 260,
1659 #[doc = "Enable the specified standard MAVLink mode. If the specified mode is not supported, the vehicle should ACK with MAV_RESULT_FAILED. See <https://mavlink.io/en/services/standard_modes.html>"]
1660 MAV_CMD_DO_SET_STANDARD_MODE = 262,
1661 #[doc = "start running a mission"]
1662 MAV_CMD_MISSION_START = 300,
1663 #[doc = "Actuator testing command. This is similar to MAV_CMD_DO_MOTOR_TEST but operates on the level of output functions, i.e. it is possible to test Motor1 independent from which output it is configured on. Autopilots must NACK this command with MAV_RESULT_TEMPORARILY_REJECTED while armed."]
1664 MAV_CMD_ACTUATOR_TEST = 310,
1665 #[doc = "Actuator configuration command."]
1666 MAV_CMD_CONFIGURE_ACTUATOR = 311,
1667 #[doc = "Arms / Disarms a component"]
1668 MAV_CMD_COMPONENT_ARM_DISARM = 400,
1669 #[doc = "Instructs a target system to run pre-arm checks. This allows preflight checks to be run on demand, which may be useful on systems that normally run them at low rate, or which do not trigger checks when the armable state might have changed. This command should return MAV_RESULT_ACCEPTED if it will run the checks. The results of the checks are usually then reported in SYS_STATUS messages (this is system-specific). The command should return MAV_RESULT_TEMPORARILY_REJECTED if the system is already armed."]
1670 MAV_CMD_RUN_PREARM_CHECKS = 401,
1671 #[doc = "Turns illuminators ON/OFF. An illuminator is a light source that is used for lighting up dark areas external to the system: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
1672 MAV_CMD_ILLUMINATOR_ON_OFF = 405,
1673 #[doc = "Configures illuminator settings. An illuminator is a light source that is used for lighting up dark areas external to the system: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
1674 MAV_CMD_DO_ILLUMINATOR_CONFIGURE = 406,
1675 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2022-04)"]
1676 #[doc = "Request the home position from the vehicle. \t The vehicle will ACK the command and then emit the HOME_POSITION message."]
1677 MAV_CMD_GET_HOME_POSITION = 410,
1678 #[doc = "Inject artificial failure for testing purposes. Note that autopilots should implement an additional protection before accepting this command such as a specific param setting."]
1679 MAV_CMD_INJECT_FAILURE = 420,
1680 #[doc = "Starts receiver pairing."]
1681 MAV_CMD_START_RX_PAIR = 500,
1682 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2022-04)"]
1683 #[doc = "Request the interval between messages for a particular MAVLink message ID. The receiver should ACK the command and then emit its response in a MESSAGE_INTERVAL message."]
1684 MAV_CMD_GET_MESSAGE_INTERVAL = 510,
1685 #[doc = "Set the interval between messages for a particular MAVLink message ID. This interface replaces REQUEST_DATA_STREAM."]
1686 MAV_CMD_SET_MESSAGE_INTERVAL = 511,
1687 #[doc = "Request the target system(s) emit a single instance of a specified message (i.e. a \"one-shot\" version of MAV_CMD_SET_MESSAGE_INTERVAL)."]
1688 MAV_CMD_REQUEST_MESSAGE = 512,
1689 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1690 #[doc = "Request MAVLink protocol version compatibility. All receivers should ACK the command and then emit their capabilities in an PROTOCOL_VERSION message"]
1691 MAV_CMD_REQUEST_PROTOCOL_VERSION = 519,
1692 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1693 #[doc = "Request autopilot capabilities. The receiver should ACK the command and then emit its capabilities in an AUTOPILOT_VERSION message"]
1694 MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES = 520,
1695 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1696 #[doc = "Request camera information (CAMERA_INFORMATION)."]
1697 MAV_CMD_REQUEST_CAMERA_INFORMATION = 521,
1698 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1699 #[doc = "Request camera settings (CAMERA_SETTINGS)."]
1700 MAV_CMD_REQUEST_CAMERA_SETTINGS = 522,
1701 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1702 #[doc = "Request storage information (STORAGE_INFORMATION). Use the command's target_component to target a specific component's storage."]
1703 MAV_CMD_REQUEST_STORAGE_INFORMATION = 525,
1704 #[doc = "Format a storage medium. Once format is complete, a STORAGE_INFORMATION message is sent. Use the command's target_component to target a specific component's storage."]
1705 MAV_CMD_STORAGE_FORMAT = 526,
1706 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1707 #[doc = "Request camera capture status (CAMERA_CAPTURE_STATUS)"]
1708 MAV_CMD_REQUEST_CAMERA_CAPTURE_STATUS = 527,
1709 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1710 #[doc = "Request flight information (FLIGHT_INFORMATION)"]
1711 MAV_CMD_REQUEST_FLIGHT_INFORMATION = 528,
1712 #[doc = "Reset all camera settings to Factory Default"]
1713 MAV_CMD_RESET_CAMERA_SETTINGS = 529,
1714 #[doc = "Set camera running mode. Use NaN for reserved values. GCS will send a MAV_CMD_REQUEST_VIDEO_STREAM_STATUS command after a mode change if the camera supports video streaming."]
1715 MAV_CMD_SET_CAMERA_MODE = 530,
1716 #[doc = "Set camera zoom. Camera must respond with a CAMERA_SETTINGS message (on success)."]
1717 MAV_CMD_SET_CAMERA_ZOOM = 531,
1718 #[doc = "Set camera focus. Camera must respond with a CAMERA_SETTINGS message (on success)."]
1719 MAV_CMD_SET_CAMERA_FOCUS = 532,
1720 #[doc = "Set that a particular storage is the preferred location for saving photos, videos, and/or other media (e.g. to set that an SD card is used for storing videos). There can only be one preferred save location for each particular media type: setting a media usage flag will clear/reset that same flag if set on any other storage. If no flag is set the system should use its default storage. A target system can choose to always use default storage, in which case it should ACK the command with MAV_RESULT_UNSUPPORTED. A target system can choose to not allow a particular storage to be set as preferred storage, in which case it should ACK the command with MAV_RESULT_DENIED."]
1721 MAV_CMD_SET_STORAGE_USAGE = 533,
1722 #[doc = "Set camera source. Changes the camera's active sources on cameras with multiple image sensors."]
1723 MAV_CMD_SET_CAMERA_SOURCE = 534,
1724 #[doc = "Tagged jump target. Can be jumped to with MAV_CMD_DO_JUMP_TAG."]
1725 MAV_CMD_JUMP_TAG = 600,
1726 #[doc = "Jump to the matching tag in the mission list. Repeat this action for the specified number of times. A mission should contain a single matching tag for each jump. If this is not the case then a jump to a missing tag should complete the mission, and a jump where there are multiple matching tags should always select the one with the lowest mission sequence number."]
1727 MAV_CMD_DO_JUMP_TAG = 601,
1728 #[doc = "Set gimbal manager pitch/yaw setpoints (low rate command). It is possible to set combinations of the values below. E.g. an angle as well as a desired angular rate can be used to get to this angle at a certain angular rate, or an angular rate only will result in continuous turning. NaN is to be used to signal unset. Note: only the gimbal manager will react to this command - it will be ignored by a gimbal device. Use GIMBAL_MANAGER_SET_PITCHYAW if you need to stream pitch/yaw setpoints at higher rate."]
1729 MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW = 1000,
1730 #[doc = "Gimbal configuration to set which sysid/compid is in primary and secondary control."]
1731 MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE = 1001,
1732 #[doc = "Start image capture sequence. CAMERA_IMAGE_CAPTURED must be emitted after each capture. Param1 (id) may be used to specify the target camera: 0: all cameras, 1 to 6: autopilot-connected cameras, 7-255: MAVLink camera component ID. It is needed in order to target specific cameras connected to the autopilot, or specific sensors in a multi-sensor camera (neither of which have a distinct MAVLink component ID). It is also needed to specify the target camera in missions. When used in a mission, an autopilot should execute the MAV_CMD for a specified local camera (param1 = 1-6), or resend it as a command if it is intended for a MAVLink camera (param1 = 7 - 255), setting the command's target_component as the param1 value (and setting param1 in the command to zero). If the param1 is 0 the autopilot should do both. When sent in a command the target MAVLink address is set using target_component. If addressed specifically to an autopilot: param1 should be used in the same way as it is for missions (though command should NACK with MAV_RESULT_DENIED if a specified local camera does not exist). If addressed to a MAVLink camera, param 1 can be used to address all cameras (0), or to separately address 1 to 7 individual sensors. Other values should be NACKed with MAV_RESULT_DENIED. If the command is broadcast (target_component is 0) then param 1 should be set to 0 (any other value should be NACKED with MAV_RESULT_DENIED). An autopilot would trigger any local cameras and forward the command to all channels."]
1733 MAV_CMD_IMAGE_START_CAPTURE = 2000,
1734 #[doc = "Stop image capture sequence. Param1 (id) may be used to specify the target camera: 0: all cameras, 1 to 6: autopilot-connected cameras, 7-255: MAVLink camera component ID. It is needed in order to target specific cameras connected to the autopilot, or specific sensors in a multi-sensor camera (neither of which have a distinct MAVLink component ID). It is also needed to specify the target camera in missions. When used in a mission, an autopilot should execute the MAV_CMD for a specified local camera (param1 = 1-6), or resend it as a command if it is intended for a MAVLink camera (param1 = 7 - 255), setting the command's target_component as the param1 value (and setting param1 in the command to zero). If the param1 is 0 the autopilot should do both. When sent in a command the target MAVLink address is set using target_component. If addressed specifically to an autopilot: param1 should be used in the same way as it is for missions (though command should NACK with MAV_RESULT_DENIED if a specified local camera does not exist). If addressed to a MAVLink camera, param1 can be used to address all cameras (0), or to separately address 1 to 7 individual sensors. Other values should be NACKed with MAV_RESULT_DENIED. If the command is broadcast (target_component is 0) then param 1 should be set to 0 (any other value should be NACKED with MAV_RESULT_DENIED). An autopilot would trigger any local cameras and forward the command to all channels."]
1735 MAV_CMD_IMAGE_STOP_CAPTURE = 2001,
1736 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1737 #[doc = "Re-request a CAMERA_IMAGE_CAPTURED message."]
1738 MAV_CMD_REQUEST_CAMERA_IMAGE_CAPTURE = 2002,
1739 #[doc = "Enable or disable on-board camera triggering system."]
1740 MAV_CMD_DO_TRIGGER_CONTROL = 2003,
1741 #[doc = "If the camera supports point visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_POINT is set), this command allows to initiate the tracking."]
1742 MAV_CMD_CAMERA_TRACK_POINT = 2004,
1743 #[doc = "If the camera supports rectangle visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE is set), this command allows to initiate the tracking."]
1744 MAV_CMD_CAMERA_TRACK_RECTANGLE = 2005,
1745 #[doc = "Stops ongoing tracking."]
1746 MAV_CMD_CAMERA_STOP_TRACKING = 2010,
1747 #[doc = "Starts video capture (recording)."]
1748 MAV_CMD_VIDEO_START_CAPTURE = 2500,
1749 #[doc = "Stop the current video capture (recording)."]
1750 MAV_CMD_VIDEO_STOP_CAPTURE = 2501,
1751 #[doc = "Start video streaming"]
1752 MAV_CMD_VIDEO_START_STREAMING = 2502,
1753 #[doc = "Stop the given video stream"]
1754 MAV_CMD_VIDEO_STOP_STREAMING = 2503,
1755 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1756 #[doc = "Request video stream information (VIDEO_STREAM_INFORMATION)"]
1757 MAV_CMD_REQUEST_VIDEO_STREAM_INFORMATION = 2504,
1758 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1759 #[doc = "Request video stream status (VIDEO_STREAM_STATUS)"]
1760 MAV_CMD_REQUEST_VIDEO_STREAM_STATUS = 2505,
1761 #[doc = "Request to start streaming logging data over MAVLink (see also LOGGING_DATA message)"]
1762 MAV_CMD_LOGGING_START = 2510,
1763 #[doc = "Request to stop streaming log data over MAVLink"]
1764 MAV_CMD_LOGGING_STOP = 2511,
1765 MAV_CMD_AIRFRAME_CONFIGURATION = 2520,
1766 #[doc = "Request to start/stop transmitting over the high latency telemetry"]
1767 MAV_CMD_CONTROL_HIGH_LATENCY = 2600,
1768 #[doc = "Create a panorama at the current position"]
1769 MAV_CMD_PANORAMA_CREATE = 2800,
1770 #[doc = "Request VTOL transition"]
1771 MAV_CMD_DO_VTOL_TRANSITION = 3000,
1772 #[doc = "Request authorization to arm the vehicle to a external entity, the arm authorizer is responsible to request all data that is needs from the vehicle before authorize or deny the request. \t\tIf approved the COMMAND_ACK message progress field should be set with period of time that this authorization is valid in seconds. \t\tIf the authorization is denied COMMAND_ACK.result_param2 should be set with one of the reasons in ARM_AUTH_DENIED_REASON."]
1773 MAV_CMD_ARM_AUTHORIZATION_REQUEST = 3001,
1774 #[doc = "This command sets the submode to standard guided when vehicle is in guided mode. The vehicle holds position and altitude and the user can input the desired velocities along all three axes."]
1775 MAV_CMD_SET_GUIDED_SUBMODE_STANDARD = 4000,
1776 #[doc = "This command sets submode circle when vehicle is in guided mode. Vehicle flies along a circle facing the center of the circle. The user can input the velocity along the circle and change the radius. If no input is given the vehicle will hold position."]
1777 MAV_CMD_SET_GUIDED_SUBMODE_CIRCLE = 4001,
1778 #[doc = "Delay mission state machine until gate has been reached."]
1779 MAV_CMD_CONDITION_GATE = 4501,
1780 #[doc = "Fence return point (there can only be one such point in a geofence definition). If rally points are supported they should be used instead."]
1781 MAV_CMD_NAV_FENCE_RETURN_POINT = 5000,
1782 #[doc = "Fence vertex for an inclusion polygon (the polygon must not be self-intersecting). The vehicle must stay within this area. Minimum of 3 vertices required. The vertices for a polygon must be sent sequentially, each with param1 set to the total number of vertices in the polygon."]
1783 MAV_CMD_NAV_FENCE_POLYGON_VERTEX_INCLUSION = 5001,
1784 #[doc = "Fence vertex for an exclusion polygon (the polygon must not be self-intersecting). The vehicle must stay outside this area. Minimum of 3 vertices required. The vertices for a polygon must be sent sequentially, each with param1 set to the total number of vertices in the polygon."]
1785 MAV_CMD_NAV_FENCE_POLYGON_VERTEX_EXCLUSION = 5002,
1786 #[doc = "Circular fence area. The vehicle must stay inside this area."]
1787 MAV_CMD_NAV_FENCE_CIRCLE_INCLUSION = 5003,
1788 #[doc = "Circular fence area. The vehicle must stay outside this area."]
1789 MAV_CMD_NAV_FENCE_CIRCLE_EXCLUSION = 5004,
1790 #[doc = "Rally point. You can have multiple rally points defined."]
1791 MAV_CMD_NAV_RALLY_POINT = 5100,
1792 #[doc = "Commands the vehicle to respond with a sequence of messages UAVCAN_NODE_INFO, one message per every UAVCAN node that is online. Note that some of the response messages can be lost, which the receiver can detect easily by checking whether every received UAVCAN_NODE_STATUS has a matching message UAVCAN_NODE_INFO received earlier; if not, this command should be sent again in order to request re-transmission of the node information messages."]
1793 MAV_CMD_UAVCAN_GET_NODE_INFO = 5200,
1794 #[doc = "Change state of safety switch."]
1795 MAV_CMD_DO_SET_SAFETY_SWITCH_STATE = 5300,
1796 #[doc = "Trigger the start of an ADSB-out IDENT. This should only be used when requested to do so by an Air Traffic Controller in controlled airspace. This starts the IDENT which is then typically held for 18 seconds by the hardware per the Mode A, C, and S transponder spec."]
1797 MAV_CMD_DO_ADSB_OUT_IDENT = 10001,
1798 #[deprecated = " (Deprecated since 2021-06)"]
1799 #[doc = "Deploy payload on a Lat / Lon / Alt position. This includes the navigation to reach the required release position and velocity."]
1800 MAV_CMD_PAYLOAD_PREPARE_DEPLOY = 30001,
1801 #[deprecated = " (Deprecated since 2021-06)"]
1802 #[doc = "Control the payload deployment."]
1803 MAV_CMD_PAYLOAD_CONTROL_DEPLOY = 30002,
1804 #[doc = "Magnetometer calibration based on provided known yaw. This allows for fast calibration using WMM field tables in the vehicle, given only the known yaw of the vehicle. If Latitude and longitude are both zero then use the current vehicle location."]
1805 MAV_CMD_FIXED_MAG_CAL_YAW = 42006,
1806 #[doc = "Command to operate winch."]
1807 MAV_CMD_DO_WINCH = 42600,
1808 #[doc = "Provide an external position estimate for use when dead-reckoning. This is meant to be used for occasional position resets that may be provided by a external system such as a remote pilot using landmarks over a video link."]
1809 MAV_CMD_EXTERNAL_POSITION_ESTIMATE = 43003,
1810 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1811 MAV_CMD_WAYPOINT_USER_1 = 31000,
1812 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1813 MAV_CMD_WAYPOINT_USER_2 = 31001,
1814 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1815 MAV_CMD_WAYPOINT_USER_3 = 31002,
1816 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1817 MAV_CMD_WAYPOINT_USER_4 = 31003,
1818 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1819 MAV_CMD_WAYPOINT_USER_5 = 31004,
1820 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1821 MAV_CMD_SPATIAL_USER_1 = 31005,
1822 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1823 MAV_CMD_SPATIAL_USER_2 = 31006,
1824 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1825 MAV_CMD_SPATIAL_USER_3 = 31007,
1826 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1827 MAV_CMD_SPATIAL_USER_4 = 31008,
1828 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1829 MAV_CMD_SPATIAL_USER_5 = 31009,
1830 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1831 MAV_CMD_USER_1 = 31010,
1832 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1833 MAV_CMD_USER_2 = 31011,
1834 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1835 MAV_CMD_USER_3 = 31012,
1836 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1837 MAV_CMD_USER_4 = 31013,
1838 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1839 MAV_CMD_USER_5 = 31014,
1840 #[doc = "Request forwarding of CAN packets from the given CAN bus to this component. CAN Frames are sent using CAN_FRAME and CANFD_FRAME messages"]
1841 MAV_CMD_CAN_FORWARD = 32000,
1842 #[doc = "AVSS defined command. Set PRS arm statuses."]
1843 MAV_CMD_PRS_SET_ARM = 60050,
1844 #[doc = "AVSS defined command. Gets PRS arm statuses"]
1845 MAV_CMD_PRS_GET_ARM = 60051,
1846 #[doc = "AVSS defined command. Get the PRS battery voltage in millivolts"]
1847 MAV_CMD_PRS_GET_BATTERY = 60052,
1848 #[doc = "AVSS defined command. Get the PRS error statuses."]
1849 MAV_CMD_PRS_GET_ERR = 60053,
1850 #[doc = "AVSS defined command. Set the ATS arming altitude in meters."]
1851 MAV_CMD_PRS_SET_ARM_ALTI = 60070,
1852 #[doc = "AVSS defined command. Get the ATS arming altitude in meters."]
1853 MAV_CMD_PRS_GET_ARM_ALTI = 60071,
1854 #[doc = "AVSS defined command. Shuts down the PRS system."]
1855 MAV_CMD_PRS_SHUTDOWN = 60072,
1856}
1857impl MavCmd {
1858 pub const DEFAULT: Self = Self::MAV_CMD_NAV_WAYPOINT;
1859}
1860impl Default for MavCmd {
1861 fn default() -> Self {
1862 Self::DEFAULT
1863 }
1864}
1865#[cfg_attr(feature = "ts", derive(TS))]
1866#[cfg_attr(feature = "ts", ts(export))]
1867#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1868#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1869#[cfg_attr(feature = "serde", serde(tag = "type"))]
1870#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1871#[repr(u32)]
1872#[doc = "Possible actions an aircraft can take to avoid a collision."]
1873pub enum MavCollisionAction {
1874 #[doc = "Ignore any potential collisions"]
1875 MAV_COLLISION_ACTION_NONE = 0,
1876 #[doc = "Report potential collision"]
1877 MAV_COLLISION_ACTION_REPORT = 1,
1878 #[doc = "Ascend or Descend to avoid threat"]
1879 MAV_COLLISION_ACTION_ASCEND_OR_DESCEND = 2,
1880 #[doc = "Move horizontally to avoid threat"]
1881 MAV_COLLISION_ACTION_MOVE_HORIZONTALLY = 3,
1882 #[doc = "Aircraft to move perpendicular to the collision's velocity vector"]
1883 MAV_COLLISION_ACTION_MOVE_PERPENDICULAR = 4,
1884 #[doc = "Aircraft to fly directly back to its launch point"]
1885 MAV_COLLISION_ACTION_RTL = 5,
1886 #[doc = "Aircraft to stop in place"]
1887 MAV_COLLISION_ACTION_HOVER = 6,
1888}
1889impl MavCollisionAction {
1890 pub const DEFAULT: Self = Self::MAV_COLLISION_ACTION_NONE;
1891}
1892impl Default for MavCollisionAction {
1893 fn default() -> Self {
1894 Self::DEFAULT
1895 }
1896}
1897#[cfg_attr(feature = "ts", derive(TS))]
1898#[cfg_attr(feature = "ts", ts(export))]
1899#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1900#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1901#[cfg_attr(feature = "serde", serde(tag = "type"))]
1902#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1903#[repr(u32)]
1904#[doc = "Source of information about this collision."]
1905pub enum MavCollisionSrc {
1906 #[doc = "ID field references ADSB_VEHICLE packets"]
1907 MAV_COLLISION_SRC_ADSB = 0,
1908 #[doc = "ID field references MAVLink SRC ID"]
1909 MAV_COLLISION_SRC_MAVLINK_GPS_GLOBAL_INT = 1,
1910}
1911impl MavCollisionSrc {
1912 pub const DEFAULT: Self = Self::MAV_COLLISION_SRC_ADSB;
1913}
1914impl Default for MavCollisionSrc {
1915 fn default() -> Self {
1916 Self::DEFAULT
1917 }
1918}
1919#[cfg_attr(feature = "ts", derive(TS))]
1920#[cfg_attr(feature = "ts", ts(export))]
1921#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1922#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1923#[cfg_attr(feature = "serde", serde(tag = "type"))]
1924#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1925#[repr(u32)]
1926#[doc = "Aircraft-rated danger from this threat."]
1927pub enum MavCollisionThreatLevel {
1928 #[doc = "Not a threat"]
1929 MAV_COLLISION_THREAT_LEVEL_NONE = 0,
1930 #[doc = "Craft is mildly concerned about this threat"]
1931 MAV_COLLISION_THREAT_LEVEL_LOW = 1,
1932 #[doc = "Craft is panicking, and may take actions to avoid threat"]
1933 MAV_COLLISION_THREAT_LEVEL_HIGH = 2,
1934}
1935impl MavCollisionThreatLevel {
1936 pub const DEFAULT: Self = Self::MAV_COLLISION_THREAT_LEVEL_NONE;
1937}
1938impl Default for MavCollisionThreatLevel {
1939 fn default() -> Self {
1940 Self::DEFAULT
1941 }
1942}
1943#[cfg_attr(feature = "ts", derive(TS))]
1944#[cfg_attr(feature = "ts", ts(export))]
1945#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1946#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1947#[cfg_attr(feature = "serde", serde(tag = "type"))]
1948#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1949#[repr(u32)]
1950#[doc = "Component ids (values) for the different types and instances of onboard hardware/software that might make up a MAVLink system (autopilot, cameras, servos, GPS systems, avoidance systems etc.). Components must use the appropriate ID in their source address when sending messages. Components can also use IDs to determine if they are the intended recipient of an incoming message. The MAV_COMP_ID_ALL value is used to indicate messages that must be processed by all components. When creating new entries, components that can have multiple instances (e.g. cameras, servos etc.) should be allocated sequential values. An appropriate number of values should be left free after these components to allow the number of instances to be expanded."]
1951pub enum MavComponent {
1952 #[doc = "Target id (target_component) used to broadcast messages to all components of the receiving system. Components should attempt to process messages with this component ID and forward to components on any other interfaces. Note: This is not a valid *source* component id for a message."]
1953 MAV_COMP_ID_ALL = 0,
1954 #[doc = "System flight controller component (\"autopilot\"). Only one autopilot is expected in a particular system."]
1955 MAV_COMP_ID_AUTOPILOT1 = 1,
1956 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1957 MAV_COMP_ID_USER1 = 25,
1958 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1959 MAV_COMP_ID_USER2 = 26,
1960 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1961 MAV_COMP_ID_USER3 = 27,
1962 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1963 MAV_COMP_ID_USER4 = 28,
1964 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1965 MAV_COMP_ID_USER5 = 29,
1966 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1967 MAV_COMP_ID_USER6 = 30,
1968 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1969 MAV_COMP_ID_USER7 = 31,
1970 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1971 MAV_COMP_ID_USER8 = 32,
1972 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1973 MAV_COMP_ID_USER9 = 33,
1974 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1975 MAV_COMP_ID_USER10 = 34,
1976 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1977 MAV_COMP_ID_USER11 = 35,
1978 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1979 MAV_COMP_ID_USER12 = 36,
1980 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1981 MAV_COMP_ID_USER13 = 37,
1982 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1983 MAV_COMP_ID_USER14 = 38,
1984 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1985 MAV_COMP_ID_USER15 = 39,
1986 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1987 MAV_COMP_ID_USER16 = 40,
1988 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1989 MAV_COMP_ID_USER17 = 41,
1990 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1991 MAV_COMP_ID_USER18 = 42,
1992 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1993 MAV_COMP_ID_USER19 = 43,
1994 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1995 MAV_COMP_ID_USER20 = 44,
1996 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1997 MAV_COMP_ID_USER21 = 45,
1998 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1999 MAV_COMP_ID_USER22 = 46,
2000 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2001 MAV_COMP_ID_USER23 = 47,
2002 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2003 MAV_COMP_ID_USER24 = 48,
2004 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2005 MAV_COMP_ID_USER25 = 49,
2006 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2007 MAV_COMP_ID_USER26 = 50,
2008 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2009 MAV_COMP_ID_USER27 = 51,
2010 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2011 MAV_COMP_ID_USER28 = 52,
2012 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2013 MAV_COMP_ID_USER29 = 53,
2014 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2015 MAV_COMP_ID_USER30 = 54,
2016 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2017 MAV_COMP_ID_USER31 = 55,
2018 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2019 MAV_COMP_ID_USER32 = 56,
2020 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2021 MAV_COMP_ID_USER33 = 57,
2022 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2023 MAV_COMP_ID_USER34 = 58,
2024 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2025 MAV_COMP_ID_USER35 = 59,
2026 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2027 MAV_COMP_ID_USER36 = 60,
2028 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2029 MAV_COMP_ID_USER37 = 61,
2030 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2031 MAV_COMP_ID_USER38 = 62,
2032 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2033 MAV_COMP_ID_USER39 = 63,
2034 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2035 MAV_COMP_ID_USER40 = 64,
2036 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2037 MAV_COMP_ID_USER41 = 65,
2038 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2039 MAV_COMP_ID_USER42 = 66,
2040 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2041 MAV_COMP_ID_USER43 = 67,
2042 #[doc = "Telemetry radio (e.g. SiK radio, or other component that emits RADIO_STATUS messages)."]
2043 MAV_COMP_ID_TELEMETRY_RADIO = 68,
2044 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2045 MAV_COMP_ID_USER45 = 69,
2046 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2047 MAV_COMP_ID_USER46 = 70,
2048 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2049 MAV_COMP_ID_USER47 = 71,
2050 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2051 MAV_COMP_ID_USER48 = 72,
2052 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2053 MAV_COMP_ID_USER49 = 73,
2054 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2055 MAV_COMP_ID_USER50 = 74,
2056 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2057 MAV_COMP_ID_USER51 = 75,
2058 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2059 MAV_COMP_ID_USER52 = 76,
2060 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2061 MAV_COMP_ID_USER53 = 77,
2062 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2063 MAV_COMP_ID_USER54 = 78,
2064 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2065 MAV_COMP_ID_USER55 = 79,
2066 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2067 MAV_COMP_ID_USER56 = 80,
2068 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2069 MAV_COMP_ID_USER57 = 81,
2070 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2071 MAV_COMP_ID_USER58 = 82,
2072 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2073 MAV_COMP_ID_USER59 = 83,
2074 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2075 MAV_COMP_ID_USER60 = 84,
2076 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2077 MAV_COMP_ID_USER61 = 85,
2078 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2079 MAV_COMP_ID_USER62 = 86,
2080 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2081 MAV_COMP_ID_USER63 = 87,
2082 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2083 MAV_COMP_ID_USER64 = 88,
2084 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2085 MAV_COMP_ID_USER65 = 89,
2086 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2087 MAV_COMP_ID_USER66 = 90,
2088 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2089 MAV_COMP_ID_USER67 = 91,
2090 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2091 MAV_COMP_ID_USER68 = 92,
2092 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2093 MAV_COMP_ID_USER69 = 93,
2094 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2095 MAV_COMP_ID_USER70 = 94,
2096 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2097 MAV_COMP_ID_USER71 = 95,
2098 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2099 MAV_COMP_ID_USER72 = 96,
2100 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2101 MAV_COMP_ID_USER73 = 97,
2102 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2103 MAV_COMP_ID_USER74 = 98,
2104 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2105 MAV_COMP_ID_USER75 = 99,
2106 #[doc = "Camera #1."]
2107 MAV_COMP_ID_CAMERA = 100,
2108 #[doc = "Camera #2."]
2109 MAV_COMP_ID_CAMERA2 = 101,
2110 #[doc = "Camera #3."]
2111 MAV_COMP_ID_CAMERA3 = 102,
2112 #[doc = "Camera #4."]
2113 MAV_COMP_ID_CAMERA4 = 103,
2114 #[doc = "Camera #5."]
2115 MAV_COMP_ID_CAMERA5 = 104,
2116 #[doc = "Camera #6."]
2117 MAV_COMP_ID_CAMERA6 = 105,
2118 #[doc = "Servo #1."]
2119 MAV_COMP_ID_SERVO1 = 140,
2120 #[doc = "Servo #2."]
2121 MAV_COMP_ID_SERVO2 = 141,
2122 #[doc = "Servo #3."]
2123 MAV_COMP_ID_SERVO3 = 142,
2124 #[doc = "Servo #4."]
2125 MAV_COMP_ID_SERVO4 = 143,
2126 #[doc = "Servo #5."]
2127 MAV_COMP_ID_SERVO5 = 144,
2128 #[doc = "Servo #6."]
2129 MAV_COMP_ID_SERVO6 = 145,
2130 #[doc = "Servo #7."]
2131 MAV_COMP_ID_SERVO7 = 146,
2132 #[doc = "Servo #8."]
2133 MAV_COMP_ID_SERVO8 = 147,
2134 #[doc = "Servo #9."]
2135 MAV_COMP_ID_SERVO9 = 148,
2136 #[doc = "Servo #10."]
2137 MAV_COMP_ID_SERVO10 = 149,
2138 #[doc = "Servo #11."]
2139 MAV_COMP_ID_SERVO11 = 150,
2140 #[doc = "Servo #12."]
2141 MAV_COMP_ID_SERVO12 = 151,
2142 #[doc = "Servo #13."]
2143 MAV_COMP_ID_SERVO13 = 152,
2144 #[doc = "Servo #14."]
2145 MAV_COMP_ID_SERVO14 = 153,
2146 #[doc = "Gimbal #1."]
2147 MAV_COMP_ID_GIMBAL = 154,
2148 #[doc = "Logging component."]
2149 MAV_COMP_ID_LOG = 155,
2150 #[doc = "Automatic Dependent Surveillance-Broadcast (ADS-B) component."]
2151 MAV_COMP_ID_ADSB = 156,
2152 #[doc = "On Screen Display (OSD) devices for video links."]
2153 MAV_COMP_ID_OSD = 157,
2154 #[doc = "Generic autopilot peripheral component ID. Meant for devices that do not implement the parameter microservice."]
2155 MAV_COMP_ID_PERIPHERAL = 158,
2156 #[deprecated = "All gimbals should use MAV_COMP_ID_GIMBAL. See `MAV_COMP_ID_GIMBAL` (Deprecated since 2018-11)"]
2157 #[doc = "Gimbal ID for QX1."]
2158 MAV_COMP_ID_QX1_GIMBAL = 159,
2159 #[doc = "FLARM collision alert component."]
2160 MAV_COMP_ID_FLARM = 160,
2161 #[doc = "Parachute component."]
2162 MAV_COMP_ID_PARACHUTE = 161,
2163 #[doc = "Winch component."]
2164 MAV_COMP_ID_WINCH = 169,
2165 #[doc = "Gimbal #2."]
2166 MAV_COMP_ID_GIMBAL2 = 171,
2167 #[doc = "Gimbal #3."]
2168 MAV_COMP_ID_GIMBAL3 = 172,
2169 #[doc = "Gimbal #4"]
2170 MAV_COMP_ID_GIMBAL4 = 173,
2171 #[doc = "Gimbal #5."]
2172 MAV_COMP_ID_GIMBAL5 = 174,
2173 #[doc = "Gimbal #6."]
2174 MAV_COMP_ID_GIMBAL6 = 175,
2175 #[doc = "Battery #1."]
2176 MAV_COMP_ID_BATTERY = 180,
2177 #[doc = "Battery #2."]
2178 MAV_COMP_ID_BATTERY2 = 181,
2179 #[doc = "CAN over MAVLink client."]
2180 MAV_COMP_ID_MAVCAN = 189,
2181 #[doc = "Component that can generate/supply a mission flight plan (e.g. GCS or developer API)."]
2182 MAV_COMP_ID_MISSIONPLANNER = 190,
2183 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2184 MAV_COMP_ID_ONBOARD_COMPUTER = 191,
2185 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2186 MAV_COMP_ID_ONBOARD_COMPUTER2 = 192,
2187 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2188 MAV_COMP_ID_ONBOARD_COMPUTER3 = 193,
2189 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2190 MAV_COMP_ID_ONBOARD_COMPUTER4 = 194,
2191 #[doc = "Component that finds an optimal path between points based on a certain constraint (e.g. minimum snap, shortest path, cost, etc.)."]
2192 MAV_COMP_ID_PATHPLANNER = 195,
2193 #[doc = "Component that plans a collision free path between two points."]
2194 MAV_COMP_ID_OBSTACLE_AVOIDANCE = 196,
2195 #[doc = "Component that provides position estimates using VIO techniques."]
2196 MAV_COMP_ID_VISUAL_INERTIAL_ODOMETRY = 197,
2197 #[doc = "Component that manages pairing of vehicle and GCS."]
2198 MAV_COMP_ID_PAIRING_MANAGER = 198,
2199 #[doc = "Inertial Measurement Unit (IMU) #1."]
2200 MAV_COMP_ID_IMU = 200,
2201 #[doc = "Inertial Measurement Unit (IMU) #2."]
2202 MAV_COMP_ID_IMU_2 = 201,
2203 #[doc = "Inertial Measurement Unit (IMU) #3."]
2204 MAV_COMP_ID_IMU_3 = 202,
2205 #[doc = "GPS #1."]
2206 MAV_COMP_ID_GPS = 220,
2207 #[doc = "GPS #2."]
2208 MAV_COMP_ID_GPS2 = 221,
2209 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2210 MAV_COMP_ID_ODID_TXRX_1 = 236,
2211 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2212 MAV_COMP_ID_ODID_TXRX_2 = 237,
2213 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2214 MAV_COMP_ID_ODID_TXRX_3 = 238,
2215 #[doc = "Component to bridge MAVLink to UDP (i.e. from a UART)."]
2216 MAV_COMP_ID_UDP_BRIDGE = 240,
2217 #[doc = "Component to bridge to UART (i.e. from UDP)."]
2218 MAV_COMP_ID_UART_BRIDGE = 241,
2219 #[doc = "Component handling TUNNEL messages (e.g. vendor specific GUI of a component)."]
2220 MAV_COMP_ID_TUNNEL_NODE = 242,
2221 #[doc = "Illuminator"]
2222 MAV_COMP_ID_ILLUMINATOR = 243,
2223 #[deprecated = "System control does not require a separate component ID. Instead, system commands should be sent with target_component=MAV_COMP_ID_ALL allowing the target component to use any appropriate component id. See `MAV_COMP_ID_ALL` (Deprecated since 2018-11)"]
2224 #[doc = "Deprecated, don't use. Component for handling system messages (e.g. to ARM, takeoff, etc.)."]
2225 MAV_COMP_ID_SYSTEM_CONTROL = 250,
2226}
2227impl MavComponent {
2228 pub const DEFAULT: Self = Self::MAV_COMP_ID_ALL;
2229}
2230impl Default for MavComponent {
2231 fn default() -> Self {
2232 Self::DEFAULT
2233 }
2234}
2235#[cfg_attr(feature = "ts", derive(TS))]
2236#[cfg_attr(feature = "ts", ts(export))]
2237#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2238#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2239#[cfg_attr(feature = "serde", serde(tag = "type"))]
2240#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2241#[repr(u32)]
2242#[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-06)"]
2243#[doc = "A data stream is not a fixed set of messages, but rather a recommendation to the autopilot software. Individual autopilots may or may not obey the recommended messages."]
2244pub enum MavDataStream {
2245 #[doc = "Enable all data streams"]
2246 MAV_DATA_STREAM_ALL = 0,
2247 #[doc = "Enable IMU_RAW, GPS_RAW, GPS_STATUS packets."]
2248 MAV_DATA_STREAM_RAW_SENSORS = 1,
2249 #[doc = "Enable GPS_STATUS, CONTROL_STATUS, AUX_STATUS"]
2250 MAV_DATA_STREAM_EXTENDED_STATUS = 2,
2251 #[doc = "Enable RC_CHANNELS_SCALED, RC_CHANNELS_RAW, SERVO_OUTPUT_RAW"]
2252 MAV_DATA_STREAM_RC_CHANNELS = 3,
2253 #[doc = "Enable ATTITUDE_CONTROLLER_OUTPUT, POSITION_CONTROLLER_OUTPUT, NAV_CONTROLLER_OUTPUT."]
2254 MAV_DATA_STREAM_RAW_CONTROLLER = 4,
2255 #[doc = "Enable LOCAL_POSITION, GLOBAL_POSITION_INT messages."]
2256 MAV_DATA_STREAM_POSITION = 6,
2257 #[doc = "Dependent on the autopilot"]
2258 MAV_DATA_STREAM_EXTRA1 = 10,
2259 #[doc = "Dependent on the autopilot"]
2260 MAV_DATA_STREAM_EXTRA2 = 11,
2261 #[doc = "Dependent on the autopilot"]
2262 MAV_DATA_STREAM_EXTRA3 = 12,
2263}
2264impl MavDataStream {
2265 pub const DEFAULT: Self = Self::MAV_DATA_STREAM_ALL;
2266}
2267impl Default for MavDataStream {
2268 fn default() -> Self {
2269 Self::DEFAULT
2270 }
2271}
2272#[cfg_attr(feature = "ts", derive(TS))]
2273#[cfg_attr(feature = "ts", ts(export))]
2274#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2275#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2276#[cfg_attr(feature = "serde", serde(tag = "type"))]
2277#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2278#[repr(u32)]
2279#[doc = "Enumeration of distance sensor types"]
2280pub enum MavDistanceSensor {
2281 #[doc = "Laser rangefinder, e.g. LightWare SF02/F or PulsedLight units"]
2282 MAV_DISTANCE_SENSOR_LASER = 0,
2283 #[doc = "Ultrasound rangefinder, e.g. MaxBotix units"]
2284 MAV_DISTANCE_SENSOR_ULTRASOUND = 1,
2285 #[doc = "Infrared rangefinder, e.g. Sharp units"]
2286 MAV_DISTANCE_SENSOR_INFRARED = 2,
2287 #[doc = "Radar type, e.g. uLanding units"]
2288 MAV_DISTANCE_SENSOR_RADAR = 3,
2289 #[doc = "Broken or unknown type, e.g. analog units"]
2290 MAV_DISTANCE_SENSOR_UNKNOWN = 4,
2291}
2292impl MavDistanceSensor {
2293 pub const DEFAULT: Self = Self::MAV_DISTANCE_SENSOR_LASER;
2294}
2295impl Default for MavDistanceSensor {
2296 fn default() -> Self {
2297 Self::DEFAULT
2298 }
2299}
2300#[cfg_attr(feature = "ts", derive(TS))]
2301#[cfg_attr(feature = "ts", ts(export))]
2302#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2303#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2304#[cfg_attr(feature = "serde", serde(tag = "type"))]
2305#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2306#[repr(u32)]
2307#[doc = "Bitmap of options for the MAV_CMD_DO_REPOSITION"]
2308pub enum MavDoRepositionFlags {
2309 #[doc = "The aircraft should immediately transition into guided. This should not be set for follow me applications"]
2310 MAV_DO_REPOSITION_FLAGS_CHANGE_MODE = 1,
2311}
2312impl MavDoRepositionFlags {
2313 pub const DEFAULT: Self = Self::MAV_DO_REPOSITION_FLAGS_CHANGE_MODE;
2314}
2315impl Default for MavDoRepositionFlags {
2316 fn default() -> Self {
2317 Self::DEFAULT
2318 }
2319}
2320#[cfg_attr(feature = "ts", derive(TS))]
2321#[cfg_attr(feature = "ts", ts(export))]
2322#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2323#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2324#[cfg_attr(feature = "serde", serde(tag = "type"))]
2325#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2326#[repr(u32)]
2327#[doc = "Enumeration of estimator types"]
2328pub enum MavEstimatorType {
2329 #[doc = "Unknown type of the estimator."]
2330 MAV_ESTIMATOR_TYPE_UNKNOWN = 0,
2331 #[doc = "This is a naive estimator without any real covariance feedback."]
2332 MAV_ESTIMATOR_TYPE_NAIVE = 1,
2333 #[doc = "Computer vision based estimate. Might be up to scale."]
2334 MAV_ESTIMATOR_TYPE_VISION = 2,
2335 #[doc = "Visual-inertial estimate."]
2336 MAV_ESTIMATOR_TYPE_VIO = 3,
2337 #[doc = "Plain GPS estimate."]
2338 MAV_ESTIMATOR_TYPE_GPS = 4,
2339 #[doc = "Estimator integrating GPS and inertial sensing."]
2340 MAV_ESTIMATOR_TYPE_GPS_INS = 5,
2341 #[doc = "Estimate from external motion capturing system."]
2342 MAV_ESTIMATOR_TYPE_MOCAP = 6,
2343 #[doc = "Estimator based on lidar sensor input."]
2344 MAV_ESTIMATOR_TYPE_LIDAR = 7,
2345 #[doc = "Estimator on autopilot."]
2346 MAV_ESTIMATOR_TYPE_AUTOPILOT = 8,
2347}
2348impl MavEstimatorType {
2349 pub const DEFAULT: Self = Self::MAV_ESTIMATOR_TYPE_UNKNOWN;
2350}
2351impl Default for MavEstimatorType {
2352 fn default() -> Self {
2353 Self::DEFAULT
2354 }
2355}
2356#[cfg_attr(feature = "ts", derive(TS))]
2357#[cfg_attr(feature = "ts", ts(export))]
2358#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2359#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2360#[cfg_attr(feature = "serde", serde(tag = "type"))]
2361#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2362#[repr(u32)]
2363#[doc = "Flags for CURRENT_EVENT_SEQUENCE."]
2364pub enum MavEventCurrentSequenceFlags {
2365 #[doc = "A sequence reset has happened (e.g. vehicle reboot)."]
2366 MAV_EVENT_CURRENT_SEQUENCE_FLAGS_RESET = 1,
2367}
2368impl MavEventCurrentSequenceFlags {
2369 pub const DEFAULT: Self = Self::MAV_EVENT_CURRENT_SEQUENCE_FLAGS_RESET;
2370}
2371impl Default for MavEventCurrentSequenceFlags {
2372 fn default() -> Self {
2373 Self::DEFAULT
2374 }
2375}
2376#[cfg_attr(feature = "ts", derive(TS))]
2377#[cfg_attr(feature = "ts", ts(export))]
2378#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2379#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2380#[cfg_attr(feature = "serde", serde(tag = "type"))]
2381#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2382#[repr(u32)]
2383#[doc = "Reason for an event error response."]
2384pub enum MavEventErrorReason {
2385 #[doc = "The requested event is not available (anymore)."]
2386 MAV_EVENT_ERROR_REASON_UNAVAILABLE = 0,
2387}
2388impl MavEventErrorReason {
2389 pub const DEFAULT: Self = Self::MAV_EVENT_ERROR_REASON_UNAVAILABLE;
2390}
2391impl Default for MavEventErrorReason {
2392 fn default() -> Self {
2393 Self::DEFAULT
2394 }
2395}
2396#[cfg_attr(feature = "ts", derive(TS))]
2397#[cfg_attr(feature = "ts", ts(export))]
2398#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2399#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2400#[cfg_attr(feature = "serde", serde(tag = "type"))]
2401#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2402#[repr(u32)]
2403#[doc = "Coordinate frames used by MAVLink. Not all frames are supported by all commands, messages, or vehicles. Global frames use the following naming conventions: - \"GLOBAL\": Global coordinate frame with WGS84 latitude/longitude and altitude positive over mean sea level (MSL) by default. The following modifiers may be used with \"GLOBAL\": - \"RELATIVE_ALT\": Altitude is relative to the vehicle home position rather than MSL. - \"TERRAIN_ALT\": Altitude is relative to ground level rather than MSL. - \"INT\": Latitude/longitude (in degrees) are scaled by multiplying by 1E7. Local frames use the following naming conventions: - \"LOCAL\": Origin of local frame is fixed relative to earth. Unless otherwise specified this origin is the origin of the vehicle position-estimator (\"EKF\"). - \"BODY\": Origin of local frame travels with the vehicle. NOTE, \"BODY\" does NOT indicate alignment of frame axis with vehicle attitude. - \"OFFSET\": Deprecated synonym for \"BODY\" (origin travels with the vehicle). Not to be used for new frames. Some deprecated frames do not follow these conventions (e.g. MAV_FRAME_BODY_NED and MAV_FRAME_BODY_OFFSET_NED)."]
2404pub enum MavFrame {
2405 #[doc = "Global (WGS84) coordinate frame + altitude relative to mean sea level (MSL)."]
2406 MAV_FRAME_GLOBAL = 0,
2407 #[doc = "NED local tangent frame (x: North, y: East, z: Down) with origin fixed relative to earth."]
2408 MAV_FRAME_LOCAL_NED = 1,
2409 #[doc = "NOT a coordinate frame, indicates a mission command."]
2410 MAV_FRAME_MISSION = 2,
2411 #[doc = "Global (WGS84) coordinate frame + altitude relative to the home position."]
2412 MAV_FRAME_GLOBAL_RELATIVE_ALT = 3,
2413 #[doc = "ENU local tangent frame (x: East, y: North, z: Up) with origin fixed relative to earth."]
2414 MAV_FRAME_LOCAL_ENU = 4,
2415 #[deprecated = "Use MAV_FRAME_GLOBAL in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL` (Deprecated since 2024-03)"]
2416 #[doc = "Global (WGS84) coordinate frame (scaled) + altitude relative to mean sea level (MSL)."]
2417 MAV_FRAME_GLOBAL_INT = 5,
2418 #[deprecated = "Use MAV_FRAME_GLOBAL_RELATIVE_ALT in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL_RELATIVE_ALT` (Deprecated since 2024-03)"]
2419 #[doc = "Global (WGS84) coordinate frame (scaled) + altitude relative to the home position."]
2420 MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6,
2421 #[doc = "NED local tangent frame (x: North, y: East, z: Down) with origin that travels with the vehicle."]
2422 MAV_FRAME_LOCAL_OFFSET_NED = 7,
2423 #[deprecated = " See `MAV_FRAME_BODY_FRD` (Deprecated since 2019-08)"]
2424 #[doc = "Same as MAV_FRAME_LOCAL_NED when used to represent position values. Same as MAV_FRAME_BODY_FRD when used with velocity/acceleration values."]
2425 MAV_FRAME_BODY_NED = 8,
2426 #[deprecated = " See `MAV_FRAME_BODY_FRD` (Deprecated since 2019-08)"]
2427 #[doc = "This is the same as MAV_FRAME_BODY_FRD."]
2428 MAV_FRAME_BODY_OFFSET_NED = 9,
2429 #[doc = "Global (WGS84) coordinate frame with AGL altitude (altitude at ground level)."]
2430 MAV_FRAME_GLOBAL_TERRAIN_ALT = 10,
2431 #[deprecated = "Use MAV_FRAME_GLOBAL_TERRAIN_ALT in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL_TERRAIN_ALT` (Deprecated since 2024-03)"]
2432 #[doc = "Global (WGS84) coordinate frame (scaled) with AGL altitude (altitude at ground level)."]
2433 MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11,
2434 #[doc = "FRD local frame aligned to the vehicle's attitude (x: Forward, y: Right, z: Down) with an origin that travels with vehicle."]
2435 MAV_FRAME_BODY_FRD = 12,
2436 #[deprecated = " (Deprecated since 2019-04)"]
2437 #[doc = "MAV_FRAME_BODY_FLU - Body fixed frame of reference, Z-up (x: Forward, y: Left, z: Up)."]
2438 MAV_FRAME_RESERVED_13 = 13,
2439 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2440 #[doc = "MAV_FRAME_MOCAP_NED - Odometry local coordinate frame of data given by a motion capture system, Z-down (x: North, y: East, z: Down)."]
2441 MAV_FRAME_RESERVED_14 = 14,
2442 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2443 #[doc = "MAV_FRAME_MOCAP_ENU - Odometry local coordinate frame of data given by a motion capture system, Z-up (x: East, y: North, z: Up)."]
2444 MAV_FRAME_RESERVED_15 = 15,
2445 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2446 #[doc = "MAV_FRAME_VISION_NED - Odometry local coordinate frame of data given by a vision estimation system, Z-down (x: North, y: East, z: Down)."]
2447 MAV_FRAME_RESERVED_16 = 16,
2448 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2449 #[doc = "MAV_FRAME_VISION_ENU - Odometry local coordinate frame of data given by a vision estimation system, Z-up (x: East, y: North, z: Up)."]
2450 MAV_FRAME_RESERVED_17 = 17,
2451 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2452 #[doc = "MAV_FRAME_ESTIM_NED - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-down (x: North, y: East, z: Down)."]
2453 MAV_FRAME_RESERVED_18 = 18,
2454 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2455 #[doc = "MAV_FRAME_ESTIM_ENU - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-up (x: East, y: North, z: Up)."]
2456 MAV_FRAME_RESERVED_19 = 19,
2457 #[doc = "FRD local tangent frame (x: Forward, y: Right, z: Down) with origin fixed relative to earth. The forward axis is aligned to the front of the vehicle in the horizontal plane."]
2458 MAV_FRAME_LOCAL_FRD = 20,
2459 #[doc = "FLU local tangent frame (x: Forward, y: Left, z: Up) with origin fixed relative to earth. The forward axis is aligned to the front of the vehicle in the horizontal plane."]
2460 MAV_FRAME_LOCAL_FLU = 21,
2461}
2462impl MavFrame {
2463 pub const DEFAULT: Self = Self::MAV_FRAME_GLOBAL;
2464}
2465impl Default for MavFrame {
2466 fn default() -> Self {
2467 Self::DEFAULT
2468 }
2469}
2470#[cfg_attr(feature = "ts", derive(TS))]
2471#[cfg_attr(feature = "ts", ts(export))]
2472#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2473#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2474#[cfg_attr(feature = "serde", serde(tag = "type"))]
2475#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2476#[repr(u32)]
2477#[doc = "MAV FTP error codes (<https://mavlink.io/en/services/ftp.html>)"]
2478pub enum MavFtpErr {
2479 #[doc = "None: No error"]
2480 MAV_FTP_ERR_NONE = 0,
2481 #[doc = "Fail: Unknown failure"]
2482 MAV_FTP_ERR_FAIL = 1,
2483 #[doc = "FailErrno: Command failed, Err number sent back in PayloadHeader.data[1]. \t\tThis is a file-system error number understood by the server operating system."]
2484 MAV_FTP_ERR_FAILERRNO = 2,
2485 #[doc = "InvalidDataSize: Payload size is invalid"]
2486 MAV_FTP_ERR_INVALIDDATASIZE = 3,
2487 #[doc = "InvalidSession: Session is not currently open"]
2488 MAV_FTP_ERR_INVALIDSESSION = 4,
2489 #[doc = "NoSessionsAvailable: All available sessions are already in use"]
2490 MAV_FTP_ERR_NOSESSIONSAVAILABLE = 5,
2491 #[doc = "EOF: Offset past end of file for ListDirectory and ReadFile commands"]
2492 MAV_FTP_ERR_EOF = 6,
2493 #[doc = "UnknownCommand: Unknown command / opcode"]
2494 MAV_FTP_ERR_UNKNOWNCOMMAND = 7,
2495 #[doc = "FileExists: File/directory already exists"]
2496 MAV_FTP_ERR_FILEEXISTS = 8,
2497 #[doc = "FileProtected: File/directory is write protected"]
2498 MAV_FTP_ERR_FILEPROTECTED = 9,
2499 #[doc = "FileNotFound: File/directory not found"]
2500 MAV_FTP_ERR_FILENOTFOUND = 10,
2501}
2502impl MavFtpErr {
2503 pub const DEFAULT: Self = Self::MAV_FTP_ERR_NONE;
2504}
2505impl Default for MavFtpErr {
2506 fn default() -> Self {
2507 Self::DEFAULT
2508 }
2509}
2510#[cfg_attr(feature = "ts", derive(TS))]
2511#[cfg_attr(feature = "ts", ts(export))]
2512#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2513#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2514#[cfg_attr(feature = "serde", serde(tag = "type"))]
2515#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2516#[repr(u32)]
2517#[doc = "MAV FTP opcodes: <https://mavlink.io/en/services/ftp.html>"]
2518pub enum MavFtpOpcode {
2519 #[doc = "None. Ignored, always ACKed"]
2520 MAV_FTP_OPCODE_NONE = 0,
2521 #[doc = "TerminateSession: Terminates open Read session"]
2522 MAV_FTP_OPCODE_TERMINATESESSION = 1,
2523 #[doc = "ResetSessions: Terminates all open read sessions"]
2524 MAV_FTP_OPCODE_RESETSESSION = 2,
2525 #[doc = "ListDirectory. List files and directories in path from offset"]
2526 MAV_FTP_OPCODE_LISTDIRECTORY = 3,
2527 #[doc = "OpenFileRO: Opens file at path for reading, returns session"]
2528 MAV_FTP_OPCODE_OPENFILERO = 4,
2529 #[doc = "ReadFile: Reads size bytes from offset in session"]
2530 MAV_FTP_OPCODE_READFILE = 5,
2531 #[doc = "CreateFile: Creates file at path for writing, returns session"]
2532 MAV_FTP_OPCODE_CREATEFILE = 6,
2533 #[doc = "WriteFile: Writes size bytes to offset in session"]
2534 MAV_FTP_OPCODE_WRITEFILE = 7,
2535 #[doc = "RemoveFile: Remove file at path"]
2536 MAV_FTP_OPCODE_REMOVEFILE = 8,
2537 #[doc = "CreateDirectory: Creates directory at path"]
2538 MAV_FTP_OPCODE_CREATEDIRECTORY = 9,
2539 #[doc = "RemoveDirectory: Removes directory at path. The directory must be empty."]
2540 MAV_FTP_OPCODE_REMOVEDIRECTORY = 10,
2541 #[doc = "OpenFileWO: Opens file at path for writing, returns session"]
2542 MAV_FTP_OPCODE_OPENFILEWO = 11,
2543 #[doc = "TruncateFile: Truncate file at path to offset length"]
2544 MAV_FTP_OPCODE_TRUNCATEFILE = 12,
2545 #[doc = "Rename: Rename path1 to path2"]
2546 MAV_FTP_OPCODE_RENAME = 13,
2547 #[doc = "CalcFileCRC32: Calculate CRC32 for file at path"]
2548 MAV_FTP_OPCODE_CALCFILECRC = 14,
2549 #[doc = "BurstReadFile: Burst download session file"]
2550 MAV_FTP_OPCODE_BURSTREADFILE = 15,
2551 #[doc = "ACK: ACK response"]
2552 MAV_FTP_OPCODE_ACK = 128,
2553 #[doc = "NAK: NAK response"]
2554 MAV_FTP_OPCODE_NAK = 129,
2555}
2556impl MavFtpOpcode {
2557 pub const DEFAULT: Self = Self::MAV_FTP_OPCODE_NONE;
2558}
2559impl Default for MavFtpOpcode {
2560 fn default() -> Self {
2561 Self::DEFAULT
2562 }
2563}
2564#[cfg_attr(feature = "ts", derive(TS))]
2565#[cfg_attr(feature = "ts", ts(export))]
2566#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2567#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2568#[cfg_attr(feature = "serde", serde(tag = "type"))]
2569#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2570#[repr(u32)]
2571#[doc = "Fuel types for use in FUEL_TYPE. Fuel types specify the units for the maximum, available and consumed fuel, and for the flow rates."]
2572pub enum MavFuelType {
2573 #[doc = "Not specified. Fuel levels are normalized (i.e. maximum is 1, and other levels are relative to 1)."]
2574 MAV_FUEL_TYPE_UNKNOWN = 0,
2575 #[doc = "A generic liquid fuel. Fuel levels are in millilitres (ml). Fuel rates are in millilitres/second."]
2576 MAV_FUEL_TYPE_LIQUID = 1,
2577 #[doc = "A gas tank. Fuel levels are in kilo-Pascal (kPa), and flow rates are in milliliters per second (ml/s)."]
2578 MAV_FUEL_TYPE_GAS = 2,
2579}
2580impl MavFuelType {
2581 pub const DEFAULT: Self = Self::MAV_FUEL_TYPE_UNKNOWN;
2582}
2583impl Default for MavFuelType {
2584 fn default() -> Self {
2585 Self::DEFAULT
2586 }
2587}
2588bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report status/failure cases for a power generator (used in GENERATOR_STATUS). Note that FAULTS are conditions that cause the generator to fail. Warnings are conditions that require attention before the next use (they indicate the system is not operating properly)."] pub struct MavGeneratorStatusFlag : u64 { # [doc = "Generator is off."] const MAV_GENERATOR_STATUS_FLAG_OFF = 1 ; # [doc = "Generator is ready to start generating power."] const MAV_GENERATOR_STATUS_FLAG_READY = 2 ; # [doc = "Generator is generating power."] const MAV_GENERATOR_STATUS_FLAG_GENERATING = 4 ; # [doc = "Generator is charging the batteries (generating enough power to charge and provide the load)."] const MAV_GENERATOR_STATUS_FLAG_CHARGING = 8 ; # [doc = "Generator is operating at a reduced maximum power."] const MAV_GENERATOR_STATUS_FLAG_REDUCED_POWER = 16 ; # [doc = "Generator is providing the maximum output."] const MAV_GENERATOR_STATUS_FLAG_MAXPOWER = 32 ; # [doc = "Generator is near the maximum operating temperature, cooling is insufficient."] const MAV_GENERATOR_STATUS_FLAG_OVERTEMP_WARNING = 64 ; # [doc = "Generator hit the maximum operating temperature and shutdown."] const MAV_GENERATOR_STATUS_FLAG_OVERTEMP_FAULT = 128 ; # [doc = "Power electronics are near the maximum operating temperature, cooling is insufficient."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_WARNING = 256 ; # [doc = "Power electronics hit the maximum operating temperature and shutdown."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_FAULT = 512 ; # [doc = "Power electronics experienced a fault and shutdown."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_FAULT = 1024 ; # [doc = "The power source supplying the generator failed e.g. mechanical generator stopped, tether is no longer providing power, solar cell is in shade, hydrogen reaction no longer happening."] const MAV_GENERATOR_STATUS_FLAG_POWERSOURCE_FAULT = 2048 ; # [doc = "Generator controller having communication problems."] const MAV_GENERATOR_STATUS_FLAG_COMMUNICATION_WARNING = 4096 ; # [doc = "Power electronic or generator cooling system error."] const MAV_GENERATOR_STATUS_FLAG_COOLING_WARNING = 8192 ; # [doc = "Generator controller power rail experienced a fault."] const MAV_GENERATOR_STATUS_FLAG_POWER_RAIL_FAULT = 16384 ; # [doc = "Generator controller exceeded the overcurrent threshold and shutdown to prevent damage."] const MAV_GENERATOR_STATUS_FLAG_OVERCURRENT_FAULT = 32768 ; # [doc = "Generator controller detected a high current going into the batteries and shutdown to prevent battery damage."] const MAV_GENERATOR_STATUS_FLAG_BATTERY_OVERCHARGE_CURRENT_FAULT = 65536 ; # [doc = "Generator controller exceeded it's overvoltage threshold and shutdown to prevent it exceeding the voltage rating."] const MAV_GENERATOR_STATUS_FLAG_OVERVOLTAGE_FAULT = 131072 ; # [doc = "Batteries are under voltage (generator will not start)."] const MAV_GENERATOR_STATUS_FLAG_BATTERY_UNDERVOLT_FAULT = 262144 ; # [doc = "Generator start is inhibited by e.g. a safety switch."] const MAV_GENERATOR_STATUS_FLAG_START_INHIBITED = 524288 ; # [doc = "Generator requires maintenance."] const MAV_GENERATOR_STATUS_FLAG_MAINTENANCE_REQUIRED = 1048576 ; # [doc = "Generator is not ready to generate yet."] const MAV_GENERATOR_STATUS_FLAG_WARMING_UP = 2097152 ; # [doc = "Generator is idle."] const MAV_GENERATOR_STATUS_FLAG_IDLE = 4194304 ; } }
2589impl MavGeneratorStatusFlag {
2590 pub const DEFAULT: Self = Self::MAV_GENERATOR_STATUS_FLAG_OFF;
2591}
2592impl Default for MavGeneratorStatusFlag {
2593 fn default() -> Self {
2594 Self::DEFAULT
2595 }
2596}
2597#[cfg_attr(feature = "ts", derive(TS))]
2598#[cfg_attr(feature = "ts", ts(export))]
2599#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2600#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2601#[cfg_attr(feature = "serde", serde(tag = "type"))]
2602#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2603#[repr(u32)]
2604#[doc = "Actions that may be specified in MAV_CMD_OVERRIDE_GOTO to override mission execution."]
2605pub enum MavGoto {
2606 #[doc = "Hold at the current position."]
2607 MAV_GOTO_DO_HOLD = 0,
2608 #[doc = "Continue with the next item in mission execution."]
2609 MAV_GOTO_DO_CONTINUE = 1,
2610 #[doc = "Hold at the current position of the system"]
2611 MAV_GOTO_HOLD_AT_CURRENT_POSITION = 2,
2612 #[doc = "Hold at the position specified in the parameters of the DO_HOLD action"]
2613 MAV_GOTO_HOLD_AT_SPECIFIED_POSITION = 3,
2614}
2615impl MavGoto {
2616 pub const DEFAULT: Self = Self::MAV_GOTO_DO_HOLD;
2617}
2618impl Default for MavGoto {
2619 fn default() -> Self {
2620 Self::DEFAULT
2621 }
2622}
2623#[cfg_attr(feature = "ts", derive(TS))]
2624#[cfg_attr(feature = "ts", ts(export))]
2625#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2626#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2627#[cfg_attr(feature = "serde", serde(tag = "type"))]
2628#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2629#[repr(u32)]
2630#[doc = "Enumeration of landed detector states"]
2631pub enum MavLandedState {
2632 #[doc = "MAV landed state is unknown"]
2633 MAV_LANDED_STATE_UNDEFINED = 0,
2634 #[doc = "MAV is landed (on ground)"]
2635 MAV_LANDED_STATE_ON_GROUND = 1,
2636 #[doc = "MAV is in air"]
2637 MAV_LANDED_STATE_IN_AIR = 2,
2638 #[doc = "MAV currently taking off"]
2639 MAV_LANDED_STATE_TAKEOFF = 3,
2640 #[doc = "MAV currently landing"]
2641 MAV_LANDED_STATE_LANDING = 4,
2642}
2643impl MavLandedState {
2644 pub const DEFAULT: Self = Self::MAV_LANDED_STATE_UNDEFINED;
2645}
2646impl Default for MavLandedState {
2647 fn default() -> Self {
2648 Self::DEFAULT
2649 }
2650}
2651#[cfg_attr(feature = "ts", derive(TS))]
2652#[cfg_attr(feature = "ts", ts(export))]
2653#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2654#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2655#[cfg_attr(feature = "serde", serde(tag = "type"))]
2656#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2657#[repr(u32)]
2658#[doc = "Result of mission operation (in a MISSION_ACK message)."]
2659pub enum MavMissionResult {
2660 #[doc = "mission accepted OK"]
2661 MAV_MISSION_ACCEPTED = 0,
2662 #[doc = "Generic error / not accepting mission commands at all right now."]
2663 MAV_MISSION_ERROR = 1,
2664 #[doc = "Coordinate frame is not supported."]
2665 MAV_MISSION_UNSUPPORTED_FRAME = 2,
2666 #[doc = "Command is not supported."]
2667 MAV_MISSION_UNSUPPORTED = 3,
2668 #[doc = "Mission items exceed storage space."]
2669 MAV_MISSION_NO_SPACE = 4,
2670 #[doc = "One of the parameters has an invalid value."]
2671 MAV_MISSION_INVALID = 5,
2672 #[doc = "param1 has an invalid value."]
2673 MAV_MISSION_INVALID_PARAM1 = 6,
2674 #[doc = "param2 has an invalid value."]
2675 MAV_MISSION_INVALID_PARAM2 = 7,
2676 #[doc = "param3 has an invalid value."]
2677 MAV_MISSION_INVALID_PARAM3 = 8,
2678 #[doc = "param4 has an invalid value."]
2679 MAV_MISSION_INVALID_PARAM4 = 9,
2680 #[doc = "x / param5 has an invalid value."]
2681 MAV_MISSION_INVALID_PARAM5_X = 10,
2682 #[doc = "y / param6 has an invalid value."]
2683 MAV_MISSION_INVALID_PARAM6_Y = 11,
2684 #[doc = "z / param7 has an invalid value."]
2685 MAV_MISSION_INVALID_PARAM7 = 12,
2686 #[doc = "Mission item received out of sequence"]
2687 MAV_MISSION_INVALID_SEQUENCE = 13,
2688 #[doc = "Not accepting any mission commands from this communication partner."]
2689 MAV_MISSION_DENIED = 14,
2690 #[doc = "Current mission operation cancelled (e.g. mission upload, mission download)."]
2691 MAV_MISSION_OPERATION_CANCELLED = 15,
2692}
2693impl MavMissionResult {
2694 pub const DEFAULT: Self = Self::MAV_MISSION_ACCEPTED;
2695}
2696impl Default for MavMissionResult {
2697 fn default() -> Self {
2698 Self::DEFAULT
2699 }
2700}
2701#[cfg_attr(feature = "ts", derive(TS))]
2702#[cfg_attr(feature = "ts", ts(export))]
2703#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2704#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2705#[cfg_attr(feature = "serde", serde(tag = "type"))]
2706#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2707#[repr(u32)]
2708#[doc = "Type of mission items being requested/sent in mission protocol."]
2709pub enum MavMissionType {
2710 #[doc = "Items are mission commands for main mission."]
2711 MAV_MISSION_TYPE_MISSION = 0,
2712 #[doc = "Specifies GeoFence area(s). Items are MAV_CMD_NAV_FENCE_ GeoFence items."]
2713 MAV_MISSION_TYPE_FENCE = 1,
2714 #[doc = "Specifies the rally points for the vehicle. Rally points are alternative RTL points. Items are MAV_CMD_NAV_RALLY_POINT rally point items."]
2715 MAV_MISSION_TYPE_RALLY = 2,
2716 #[doc = "Only used in MISSION_CLEAR_ALL to clear all mission types."]
2717 MAV_MISSION_TYPE_ALL = 255,
2718}
2719impl MavMissionType {
2720 pub const DEFAULT: Self = Self::MAV_MISSION_TYPE_MISSION;
2721}
2722impl Default for MavMissionType {
2723 fn default() -> Self {
2724 Self::DEFAULT
2725 }
2726}
2727#[cfg_attr(feature = "ts", derive(TS))]
2728#[cfg_attr(feature = "ts", ts(export))]
2729#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2730#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2731#[cfg_attr(feature = "serde", serde(tag = "type"))]
2732#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2733#[repr(u32)]
2734#[doc = "These defines are predefined OR-combined mode flags. There is no need to use values from this enum, but it simplifies the use of the mode flags. Note that manual input is enabled in all modes as a safety override."]
2735pub enum MavMode {
2736 #[doc = "System is not ready to fly, booting, calibrating, etc. No flag is set."]
2737 MAV_MODE_PREFLIGHT = 0,
2738 #[doc = "System is allowed to be active, under assisted RC control."]
2739 MAV_MODE_STABILIZE_DISARMED = 80,
2740 #[doc = "System is allowed to be active, under assisted RC control."]
2741 MAV_MODE_STABILIZE_ARMED = 208,
2742 #[doc = "System is allowed to be active, under manual (RC) control, no stabilization"]
2743 MAV_MODE_MANUAL_DISARMED = 64,
2744 #[doc = "System is allowed to be active, under manual (RC) control, no stabilization"]
2745 MAV_MODE_MANUAL_ARMED = 192,
2746 #[doc = "System is allowed to be active, under autonomous control, manual setpoint"]
2747 MAV_MODE_GUIDED_DISARMED = 88,
2748 #[doc = "System is allowed to be active, under autonomous control, manual setpoint"]
2749 MAV_MODE_GUIDED_ARMED = 216,
2750 #[doc = "System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints)"]
2751 MAV_MODE_AUTO_DISARMED = 92,
2752 #[doc = "System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints)"]
2753 MAV_MODE_AUTO_ARMED = 220,
2754 #[doc = "UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only."]
2755 MAV_MODE_TEST_DISARMED = 66,
2756 #[doc = "UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only."]
2757 MAV_MODE_TEST_ARMED = 194,
2758}
2759impl MavMode {
2760 pub const DEFAULT: Self = Self::MAV_MODE_PREFLIGHT;
2761}
2762impl Default for MavMode {
2763 fn default() -> Self {
2764 Self::DEFAULT
2765 }
2766}
2767bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags encode the MAV mode."] pub struct MavModeFlag : u8 { # [doc = "0b10000000 MAV safety set to armed. Motors are enabled / running / can start. Ready to fly. Additional note: this flag is to be ignore when sent in the command MAV_CMD_DO_SET_MODE and MAV_CMD_COMPONENT_ARM_DISARM shall be used instead. The flag can still be used to report the armed state."] const MAV_MODE_FLAG_SAFETY_ARMED = 128 ; # [doc = "0b01000000 remote control input is enabled."] const MAV_MODE_FLAG_MANUAL_INPUT_ENABLED = 64 ; # [doc = "0b00100000 hardware in the loop simulation. All motors / actuators are blocked, but internal software is full operational."] const MAV_MODE_FLAG_HIL_ENABLED = 32 ; # [doc = "0b00010000 system stabilizes electronically its attitude (and optionally position). It needs however further control inputs to move around."] const MAV_MODE_FLAG_STABILIZE_ENABLED = 16 ; # [doc = "0b00001000 guided mode enabled, system flies waypoints / mission items."] const MAV_MODE_FLAG_GUIDED_ENABLED = 8 ; # [doc = "0b00000100 autonomous mode enabled, system finds its own goal positions. Guided flag can be set or not, depends on the actual implementation."] const MAV_MODE_FLAG_AUTO_ENABLED = 4 ; # [doc = "0b00000010 system has a test mode enabled. This flag is intended for temporary system tests and should not be used for stable implementations."] const MAV_MODE_FLAG_TEST_ENABLED = 2 ; # [doc = "0b00000001 Reserved for future use."] const MAV_MODE_FLAG_CUSTOM_MODE_ENABLED = 1 ; } }
2768impl MavModeFlag {
2769 pub const DEFAULT: Self = Self::MAV_MODE_FLAG_SAFETY_ARMED;
2770}
2771impl Default for MavModeFlag {
2772 fn default() -> Self {
2773 Self::DEFAULT
2774 }
2775}
2776#[cfg_attr(feature = "ts", derive(TS))]
2777#[cfg_attr(feature = "ts", ts(export))]
2778#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2779#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2780#[cfg_attr(feature = "serde", serde(tag = "type"))]
2781#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2782#[repr(u32)]
2783#[doc = "These values encode the bit positions of the decode position. These values can be used to read the value of a flag bit by combining the base_mode variable with AND with the flag position value. The result will be either 0 or 1, depending on if the flag is set or not."]
2784pub enum MavModeFlagDecodePosition {
2785 #[doc = "First bit: 10000000"]
2786 MAV_MODE_FLAG_DECODE_POSITION_SAFETY = 128,
2787 #[doc = "Second bit: 01000000"]
2788 MAV_MODE_FLAG_DECODE_POSITION_MANUAL = 64,
2789 #[doc = "Third bit: 00100000"]
2790 MAV_MODE_FLAG_DECODE_POSITION_HIL = 32,
2791 #[doc = "Fourth bit: 00010000"]
2792 MAV_MODE_FLAG_DECODE_POSITION_STABILIZE = 16,
2793 #[doc = "Fifth bit: 00001000"]
2794 MAV_MODE_FLAG_DECODE_POSITION_GUIDED = 8,
2795 #[doc = "Sixth bit: 00000100"]
2796 MAV_MODE_FLAG_DECODE_POSITION_AUTO = 4,
2797 #[doc = "Seventh bit: 00000010"]
2798 MAV_MODE_FLAG_DECODE_POSITION_TEST = 2,
2799 #[doc = "Eighth bit: 00000001"]
2800 MAV_MODE_FLAG_DECODE_POSITION_CUSTOM_MODE = 1,
2801}
2802impl MavModeFlagDecodePosition {
2803 pub const DEFAULT: Self = Self::MAV_MODE_FLAG_DECODE_POSITION_SAFETY;
2804}
2805impl Default for MavModeFlagDecodePosition {
2806 fn default() -> Self {
2807 Self::DEFAULT
2808 }
2809}
2810bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Mode properties."] pub struct MavModeProperty : u32 { # [doc = "If set, this mode is an advanced mode. For example a rate-controlled manual mode might be advanced, whereas a position-controlled manual mode is not. A GCS can optionally use this flag to configure the UI for its intended users."] const MAV_MODE_PROPERTY_ADVANCED = 1 ; # [doc = "If set, this mode should not be added to the list of selectable modes. The mode might still be selected by the FC directly (for example as part of a failsafe)."] const MAV_MODE_PROPERTY_NOT_USER_SELECTABLE = 2 ; # [doc = "If set, this mode is automatically controlled (it may use but does not require a manual controller). If unset the mode is a assumed to require user input (be a manual mode)."] const MAV_MODE_PROPERTY_AUTO_MODE = 4 ; } }
2811impl MavModeProperty {
2812 pub const DEFAULT: Self = Self::MAV_MODE_PROPERTY_ADVANCED;
2813}
2814impl Default for MavModeProperty {
2815 fn default() -> Self {
2816 Self::DEFAULT
2817 }
2818}
2819#[cfg_attr(feature = "ts", derive(TS))]
2820#[cfg_attr(feature = "ts", ts(export))]
2821#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2822#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2823#[cfg_attr(feature = "serde", serde(tag = "type"))]
2824#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2825#[repr(u32)]
2826#[deprecated = " See `GIMBAL_MANAGER_FLAGS` (Deprecated since 2020-01)"]
2827#[doc = "Enumeration of possible mount operation modes. This message is used by obsolete/deprecated gimbal messages."]
2828pub enum MavMountMode {
2829 #[doc = "Load and keep safe position (Roll,Pitch,Yaw) from permanent memory and stop stabilization"]
2830 MAV_MOUNT_MODE_RETRACT = 0,
2831 #[doc = "Load and keep neutral position (Roll,Pitch,Yaw) from permanent memory."]
2832 MAV_MOUNT_MODE_NEUTRAL = 1,
2833 #[doc = "Load neutral position and start MAVLink Roll,Pitch,Yaw control with stabilization"]
2834 MAV_MOUNT_MODE_MAVLINK_TARGETING = 2,
2835 #[doc = "Load neutral position and start RC Roll,Pitch,Yaw control with stabilization"]
2836 MAV_MOUNT_MODE_RC_TARGETING = 3,
2837 #[doc = "Load neutral position and start to point to Lat,Lon,Alt"]
2838 MAV_MOUNT_MODE_GPS_POINT = 4,
2839 #[doc = "Gimbal tracks system with specified system ID"]
2840 MAV_MOUNT_MODE_SYSID_TARGET = 5,
2841 #[doc = "Gimbal tracks home position"]
2842 MAV_MOUNT_MODE_HOME_LOCATION = 6,
2843}
2844impl MavMountMode {
2845 pub const DEFAULT: Self = Self::MAV_MOUNT_MODE_RETRACT;
2846}
2847impl Default for MavMountMode {
2848 fn default() -> Self {
2849 Self::DEFAULT
2850 }
2851}
2852#[cfg_attr(feature = "ts", derive(TS))]
2853#[cfg_attr(feature = "ts", ts(export))]
2854#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2855#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2856#[cfg_attr(feature = "serde", serde(tag = "type"))]
2857#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2858#[repr(u32)]
2859pub enum MavOdidArmStatus {
2860 #[doc = "Passing arming checks."]
2861 MAV_ODID_ARM_STATUS_GOOD_TO_ARM = 0,
2862 #[doc = "Generic arming failure, see error string for details."]
2863 MAV_ODID_ARM_STATUS_PRE_ARM_FAIL_GENERIC = 1,
2864}
2865impl MavOdidArmStatus {
2866 pub const DEFAULT: Self = Self::MAV_ODID_ARM_STATUS_GOOD_TO_ARM;
2867}
2868impl Default for MavOdidArmStatus {
2869 fn default() -> Self {
2870 Self::DEFAULT
2871 }
2872}
2873#[cfg_attr(feature = "ts", derive(TS))]
2874#[cfg_attr(feature = "ts", ts(export))]
2875#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2876#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2877#[cfg_attr(feature = "serde", serde(tag = "type"))]
2878#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2879#[repr(u32)]
2880pub enum MavOdidAuthType {
2881 #[doc = "No authentication type is specified."]
2882 MAV_ODID_AUTH_TYPE_NONE = 0,
2883 #[doc = "Signature for the UAS (Unmanned Aircraft System) ID."]
2884 MAV_ODID_AUTH_TYPE_UAS_ID_SIGNATURE = 1,
2885 #[doc = "Signature for the Operator ID."]
2886 MAV_ODID_AUTH_TYPE_OPERATOR_ID_SIGNATURE = 2,
2887 #[doc = "Signature for the entire message set."]
2888 MAV_ODID_AUTH_TYPE_MESSAGE_SET_SIGNATURE = 3,
2889 #[doc = "Authentication is provided by Network Remote ID."]
2890 MAV_ODID_AUTH_TYPE_NETWORK_REMOTE_ID = 4,
2891 #[doc = "The exact authentication type is indicated by the first byte of authentication_data and these type values are managed by ICAO."]
2892 MAV_ODID_AUTH_TYPE_SPECIFIC_AUTHENTICATION = 5,
2893}
2894impl MavOdidAuthType {
2895 pub const DEFAULT: Self = Self::MAV_ODID_AUTH_TYPE_NONE;
2896}
2897impl Default for MavOdidAuthType {
2898 fn default() -> Self {
2899 Self::DEFAULT
2900 }
2901}
2902#[cfg_attr(feature = "ts", derive(TS))]
2903#[cfg_attr(feature = "ts", ts(export))]
2904#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2905#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2906#[cfg_attr(feature = "serde", serde(tag = "type"))]
2907#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2908#[repr(u32)]
2909pub enum MavOdidCategoryEu {
2910 #[doc = "The category for the UA, according to the EU specification, is undeclared."]
2911 MAV_ODID_CATEGORY_EU_UNDECLARED = 0,
2912 #[doc = "The category for the UA, according to the EU specification, is the Open category."]
2913 MAV_ODID_CATEGORY_EU_OPEN = 1,
2914 #[doc = "The category for the UA, according to the EU specification, is the Specific category."]
2915 MAV_ODID_CATEGORY_EU_SPECIFIC = 2,
2916 #[doc = "The category for the UA, according to the EU specification, is the Certified category."]
2917 MAV_ODID_CATEGORY_EU_CERTIFIED = 3,
2918}
2919impl MavOdidCategoryEu {
2920 pub const DEFAULT: Self = Self::MAV_ODID_CATEGORY_EU_UNDECLARED;
2921}
2922impl Default for MavOdidCategoryEu {
2923 fn default() -> Self {
2924 Self::DEFAULT
2925 }
2926}
2927#[cfg_attr(feature = "ts", derive(TS))]
2928#[cfg_attr(feature = "ts", ts(export))]
2929#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2930#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2931#[cfg_attr(feature = "serde", serde(tag = "type"))]
2932#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2933#[repr(u32)]
2934pub enum MavOdidClassEu {
2935 #[doc = "The class for the UA, according to the EU specification, is undeclared."]
2936 MAV_ODID_CLASS_EU_UNDECLARED = 0,
2937 #[doc = "The class for the UA, according to the EU specification, is Class 0."]
2938 MAV_ODID_CLASS_EU_CLASS_0 = 1,
2939 #[doc = "The class for the UA, according to the EU specification, is Class 1."]
2940 MAV_ODID_CLASS_EU_CLASS_1 = 2,
2941 #[doc = "The class for the UA, according to the EU specification, is Class 2."]
2942 MAV_ODID_CLASS_EU_CLASS_2 = 3,
2943 #[doc = "The class for the UA, according to the EU specification, is Class 3."]
2944 MAV_ODID_CLASS_EU_CLASS_3 = 4,
2945 #[doc = "The class for the UA, according to the EU specification, is Class 4."]
2946 MAV_ODID_CLASS_EU_CLASS_4 = 5,
2947 #[doc = "The class for the UA, according to the EU specification, is Class 5."]
2948 MAV_ODID_CLASS_EU_CLASS_5 = 6,
2949 #[doc = "The class for the UA, according to the EU specification, is Class 6."]
2950 MAV_ODID_CLASS_EU_CLASS_6 = 7,
2951}
2952impl MavOdidClassEu {
2953 pub const DEFAULT: Self = Self::MAV_ODID_CLASS_EU_UNDECLARED;
2954}
2955impl Default for MavOdidClassEu {
2956 fn default() -> Self {
2957 Self::DEFAULT
2958 }
2959}
2960#[cfg_attr(feature = "ts", derive(TS))]
2961#[cfg_attr(feature = "ts", ts(export))]
2962#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2963#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2964#[cfg_attr(feature = "serde", serde(tag = "type"))]
2965#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2966#[repr(u32)]
2967pub enum MavOdidClassificationType {
2968 #[doc = "The classification type for the UA is undeclared."]
2969 MAV_ODID_CLASSIFICATION_TYPE_UNDECLARED = 0,
2970 #[doc = "The classification type for the UA follows EU (European Union) specifications."]
2971 MAV_ODID_CLASSIFICATION_TYPE_EU = 1,
2972}
2973impl MavOdidClassificationType {
2974 pub const DEFAULT: Self = Self::MAV_ODID_CLASSIFICATION_TYPE_UNDECLARED;
2975}
2976impl Default for MavOdidClassificationType {
2977 fn default() -> Self {
2978 Self::DEFAULT
2979 }
2980}
2981#[cfg_attr(feature = "ts", derive(TS))]
2982#[cfg_attr(feature = "ts", ts(export))]
2983#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2984#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2985#[cfg_attr(feature = "serde", serde(tag = "type"))]
2986#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2987#[repr(u32)]
2988pub enum MavOdidDescType {
2989 #[doc = "Optional free-form text description of the purpose of the flight."]
2990 MAV_ODID_DESC_TYPE_TEXT = 0,
2991 #[doc = "Optional additional clarification when status == MAV_ODID_STATUS_EMERGENCY."]
2992 MAV_ODID_DESC_TYPE_EMERGENCY = 1,
2993 #[doc = "Optional additional clarification when status != MAV_ODID_STATUS_EMERGENCY."]
2994 MAV_ODID_DESC_TYPE_EXTENDED_STATUS = 2,
2995}
2996impl MavOdidDescType {
2997 pub const DEFAULT: Self = Self::MAV_ODID_DESC_TYPE_TEXT;
2998}
2999impl Default for MavOdidDescType {
3000 fn default() -> Self {
3001 Self::DEFAULT
3002 }
3003}
3004#[cfg_attr(feature = "ts", derive(TS))]
3005#[cfg_attr(feature = "ts", ts(export))]
3006#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3007#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3008#[cfg_attr(feature = "serde", serde(tag = "type"))]
3009#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3010#[repr(u32)]
3011pub enum MavOdidHeightRef {
3012 #[doc = "The height field is relative to the take-off location."]
3013 MAV_ODID_HEIGHT_REF_OVER_TAKEOFF = 0,
3014 #[doc = "The height field is relative to ground."]
3015 MAV_ODID_HEIGHT_REF_OVER_GROUND = 1,
3016}
3017impl MavOdidHeightRef {
3018 pub const DEFAULT: Self = Self::MAV_ODID_HEIGHT_REF_OVER_TAKEOFF;
3019}
3020impl Default for MavOdidHeightRef {
3021 fn default() -> Self {
3022 Self::DEFAULT
3023 }
3024}
3025#[cfg_attr(feature = "ts", derive(TS))]
3026#[cfg_attr(feature = "ts", ts(export))]
3027#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3028#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3029#[cfg_attr(feature = "serde", serde(tag = "type"))]
3030#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3031#[repr(u32)]
3032pub enum MavOdidHorAcc {
3033 #[doc = "The horizontal accuracy is unknown."]
3034 MAV_ODID_HOR_ACC_UNKNOWN = 0,
3035 #[doc = "The horizontal accuracy is smaller than 10 Nautical Miles. 18.52 km."]
3036 MAV_ODID_HOR_ACC_10NM = 1,
3037 #[doc = "The horizontal accuracy is smaller than 4 Nautical Miles. 7.408 km."]
3038 MAV_ODID_HOR_ACC_4NM = 2,
3039 #[doc = "The horizontal accuracy is smaller than 2 Nautical Miles. 3.704 km."]
3040 MAV_ODID_HOR_ACC_2NM = 3,
3041 #[doc = "The horizontal accuracy is smaller than 1 Nautical Miles. 1.852 km."]
3042 MAV_ODID_HOR_ACC_1NM = 4,
3043 #[doc = "The horizontal accuracy is smaller than 0.5 Nautical Miles. 926 m."]
3044 MAV_ODID_HOR_ACC_0_5NM = 5,
3045 #[doc = "The horizontal accuracy is smaller than 0.3 Nautical Miles. 555.6 m."]
3046 MAV_ODID_HOR_ACC_0_3NM = 6,
3047 #[doc = "The horizontal accuracy is smaller than 0.1 Nautical Miles. 185.2 m."]
3048 MAV_ODID_HOR_ACC_0_1NM = 7,
3049 #[doc = "The horizontal accuracy is smaller than 0.05 Nautical Miles. 92.6 m."]
3050 MAV_ODID_HOR_ACC_0_05NM = 8,
3051 #[doc = "The horizontal accuracy is smaller than 30 meter."]
3052 MAV_ODID_HOR_ACC_30_METER = 9,
3053 #[doc = "The horizontal accuracy is smaller than 10 meter."]
3054 MAV_ODID_HOR_ACC_10_METER = 10,
3055 #[doc = "The horizontal accuracy is smaller than 3 meter."]
3056 MAV_ODID_HOR_ACC_3_METER = 11,
3057 #[doc = "The horizontal accuracy is smaller than 1 meter."]
3058 MAV_ODID_HOR_ACC_1_METER = 12,
3059}
3060impl MavOdidHorAcc {
3061 pub const DEFAULT: Self = Self::MAV_ODID_HOR_ACC_UNKNOWN;
3062}
3063impl Default for MavOdidHorAcc {
3064 fn default() -> Self {
3065 Self::DEFAULT
3066 }
3067}
3068#[cfg_attr(feature = "ts", derive(TS))]
3069#[cfg_attr(feature = "ts", ts(export))]
3070#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3071#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3072#[cfg_attr(feature = "serde", serde(tag = "type"))]
3073#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3074#[repr(u32)]
3075pub enum MavOdidIdType {
3076 #[doc = "No type defined."]
3077 MAV_ODID_ID_TYPE_NONE = 0,
3078 #[doc = "Manufacturer Serial Number (ANSI/CTA-2063 format)."]
3079 MAV_ODID_ID_TYPE_SERIAL_NUMBER = 1,
3080 #[doc = "CAA (Civil Aviation Authority) registered ID. Format: [ICAO Country Code].[CAA Assigned ID]."]
3081 MAV_ODID_ID_TYPE_CAA_REGISTRATION_ID = 2,
3082 #[doc = "UTM (Unmanned Traffic Management) assigned UUID (RFC4122)."]
3083 MAV_ODID_ID_TYPE_UTM_ASSIGNED_UUID = 3,
3084 #[doc = "A 20 byte ID for a specific flight/session. The exact ID type is indicated by the first byte of uas_id and these type values are managed by ICAO."]
3085 MAV_ODID_ID_TYPE_SPECIFIC_SESSION_ID = 4,
3086}
3087impl MavOdidIdType {
3088 pub const DEFAULT: Self = Self::MAV_ODID_ID_TYPE_NONE;
3089}
3090impl Default for MavOdidIdType {
3091 fn default() -> Self {
3092 Self::DEFAULT
3093 }
3094}
3095#[cfg_attr(feature = "ts", derive(TS))]
3096#[cfg_attr(feature = "ts", ts(export))]
3097#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3098#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3099#[cfg_attr(feature = "serde", serde(tag = "type"))]
3100#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3101#[repr(u32)]
3102pub enum MavOdidOperatorIdType {
3103 #[doc = "CAA (Civil Aviation Authority) registered operator ID."]
3104 MAV_ODID_OPERATOR_ID_TYPE_CAA = 0,
3105}
3106impl MavOdidOperatorIdType {
3107 pub const DEFAULT: Self = Self::MAV_ODID_OPERATOR_ID_TYPE_CAA;
3108}
3109impl Default for MavOdidOperatorIdType {
3110 fn default() -> Self {
3111 Self::DEFAULT
3112 }
3113}
3114#[cfg_attr(feature = "ts", derive(TS))]
3115#[cfg_attr(feature = "ts", ts(export))]
3116#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3117#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3118#[cfg_attr(feature = "serde", serde(tag = "type"))]
3119#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3120#[repr(u32)]
3121pub enum MavOdidOperatorLocationType {
3122 #[doc = "The location/altitude of the operator is the same as the take-off location."]
3123 MAV_ODID_OPERATOR_LOCATION_TYPE_TAKEOFF = 0,
3124 #[doc = "The location/altitude of the operator is dynamic. E.g. based on live GNSS data."]
3125 MAV_ODID_OPERATOR_LOCATION_TYPE_LIVE_GNSS = 1,
3126 #[doc = "The location/altitude of the operator are fixed values."]
3127 MAV_ODID_OPERATOR_LOCATION_TYPE_FIXED = 2,
3128}
3129impl MavOdidOperatorLocationType {
3130 pub const DEFAULT: Self = Self::MAV_ODID_OPERATOR_LOCATION_TYPE_TAKEOFF;
3131}
3132impl Default for MavOdidOperatorLocationType {
3133 fn default() -> Self {
3134 Self::DEFAULT
3135 }
3136}
3137#[cfg_attr(feature = "ts", derive(TS))]
3138#[cfg_attr(feature = "ts", ts(export))]
3139#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3140#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3141#[cfg_attr(feature = "serde", serde(tag = "type"))]
3142#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3143#[repr(u32)]
3144pub enum MavOdidSpeedAcc {
3145 #[doc = "The speed accuracy is unknown."]
3146 MAV_ODID_SPEED_ACC_UNKNOWN = 0,
3147 #[doc = "The speed accuracy is smaller than 10 meters per second."]
3148 MAV_ODID_SPEED_ACC_10_METERS_PER_SECOND = 1,
3149 #[doc = "The speed accuracy is smaller than 3 meters per second."]
3150 MAV_ODID_SPEED_ACC_3_METERS_PER_SECOND = 2,
3151 #[doc = "The speed accuracy is smaller than 1 meters per second."]
3152 MAV_ODID_SPEED_ACC_1_METERS_PER_SECOND = 3,
3153 #[doc = "The speed accuracy is smaller than 0.3 meters per second."]
3154 MAV_ODID_SPEED_ACC_0_3_METERS_PER_SECOND = 4,
3155}
3156impl MavOdidSpeedAcc {
3157 pub const DEFAULT: Self = Self::MAV_ODID_SPEED_ACC_UNKNOWN;
3158}
3159impl Default for MavOdidSpeedAcc {
3160 fn default() -> Self {
3161 Self::DEFAULT
3162 }
3163}
3164#[cfg_attr(feature = "ts", derive(TS))]
3165#[cfg_attr(feature = "ts", ts(export))]
3166#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3167#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3168#[cfg_attr(feature = "serde", serde(tag = "type"))]
3169#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3170#[repr(u32)]
3171pub enum MavOdidStatus {
3172 #[doc = "The status of the (UA) Unmanned Aircraft is undefined."]
3173 MAV_ODID_STATUS_UNDECLARED = 0,
3174 #[doc = "The UA is on the ground."]
3175 MAV_ODID_STATUS_GROUND = 1,
3176 #[doc = "The UA is in the air."]
3177 MAV_ODID_STATUS_AIRBORNE = 2,
3178 #[doc = "The UA is having an emergency."]
3179 MAV_ODID_STATUS_EMERGENCY = 3,
3180 #[doc = "The remote ID system is failing or unreliable in some way."]
3181 MAV_ODID_STATUS_REMOTE_ID_SYSTEM_FAILURE = 4,
3182}
3183impl MavOdidStatus {
3184 pub const DEFAULT: Self = Self::MAV_ODID_STATUS_UNDECLARED;
3185}
3186impl Default for MavOdidStatus {
3187 fn default() -> Self {
3188 Self::DEFAULT
3189 }
3190}
3191#[cfg_attr(feature = "ts", derive(TS))]
3192#[cfg_attr(feature = "ts", ts(export))]
3193#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3194#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3195#[cfg_attr(feature = "serde", serde(tag = "type"))]
3196#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3197#[repr(u32)]
3198pub enum MavOdidTimeAcc {
3199 #[doc = "The timestamp accuracy is unknown."]
3200 MAV_ODID_TIME_ACC_UNKNOWN = 0,
3201 #[doc = "The timestamp accuracy is smaller than or equal to 0.1 second."]
3202 MAV_ODID_TIME_ACC_0_1_SECOND = 1,
3203 #[doc = "The timestamp accuracy is smaller than or equal to 0.2 second."]
3204 MAV_ODID_TIME_ACC_0_2_SECOND = 2,
3205 #[doc = "The timestamp accuracy is smaller than or equal to 0.3 second."]
3206 MAV_ODID_TIME_ACC_0_3_SECOND = 3,
3207 #[doc = "The timestamp accuracy is smaller than or equal to 0.4 second."]
3208 MAV_ODID_TIME_ACC_0_4_SECOND = 4,
3209 #[doc = "The timestamp accuracy is smaller than or equal to 0.5 second."]
3210 MAV_ODID_TIME_ACC_0_5_SECOND = 5,
3211 #[doc = "The timestamp accuracy is smaller than or equal to 0.6 second."]
3212 MAV_ODID_TIME_ACC_0_6_SECOND = 6,
3213 #[doc = "The timestamp accuracy is smaller than or equal to 0.7 second."]
3214 MAV_ODID_TIME_ACC_0_7_SECOND = 7,
3215 #[doc = "The timestamp accuracy is smaller than or equal to 0.8 second."]
3216 MAV_ODID_TIME_ACC_0_8_SECOND = 8,
3217 #[doc = "The timestamp accuracy is smaller than or equal to 0.9 second."]
3218 MAV_ODID_TIME_ACC_0_9_SECOND = 9,
3219 #[doc = "The timestamp accuracy is smaller than or equal to 1.0 second."]
3220 MAV_ODID_TIME_ACC_1_0_SECOND = 10,
3221 #[doc = "The timestamp accuracy is smaller than or equal to 1.1 second."]
3222 MAV_ODID_TIME_ACC_1_1_SECOND = 11,
3223 #[doc = "The timestamp accuracy is smaller than or equal to 1.2 second."]
3224 MAV_ODID_TIME_ACC_1_2_SECOND = 12,
3225 #[doc = "The timestamp accuracy is smaller than or equal to 1.3 second."]
3226 MAV_ODID_TIME_ACC_1_3_SECOND = 13,
3227 #[doc = "The timestamp accuracy is smaller than or equal to 1.4 second."]
3228 MAV_ODID_TIME_ACC_1_4_SECOND = 14,
3229 #[doc = "The timestamp accuracy is smaller than or equal to 1.5 second."]
3230 MAV_ODID_TIME_ACC_1_5_SECOND = 15,
3231}
3232impl MavOdidTimeAcc {
3233 pub const DEFAULT: Self = Self::MAV_ODID_TIME_ACC_UNKNOWN;
3234}
3235impl Default for MavOdidTimeAcc {
3236 fn default() -> Self {
3237 Self::DEFAULT
3238 }
3239}
3240#[cfg_attr(feature = "ts", derive(TS))]
3241#[cfg_attr(feature = "ts", ts(export))]
3242#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3243#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3244#[cfg_attr(feature = "serde", serde(tag = "type"))]
3245#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3246#[repr(u32)]
3247pub enum MavOdidUaType {
3248 #[doc = "No UA (Unmanned Aircraft) type defined."]
3249 MAV_ODID_UA_TYPE_NONE = 0,
3250 #[doc = "Aeroplane/Airplane. Fixed wing."]
3251 MAV_ODID_UA_TYPE_AEROPLANE = 1,
3252 #[doc = "Helicopter or multirotor."]
3253 MAV_ODID_UA_TYPE_HELICOPTER_OR_MULTIROTOR = 2,
3254 #[doc = "Gyroplane."]
3255 MAV_ODID_UA_TYPE_GYROPLANE = 3,
3256 #[doc = "VTOL (Vertical Take-Off and Landing). Fixed wing aircraft that can take off vertically."]
3257 MAV_ODID_UA_TYPE_HYBRID_LIFT = 4,
3258 #[doc = "Ornithopter."]
3259 MAV_ODID_UA_TYPE_ORNITHOPTER = 5,
3260 #[doc = "Glider."]
3261 MAV_ODID_UA_TYPE_GLIDER = 6,
3262 #[doc = "Kite."]
3263 MAV_ODID_UA_TYPE_KITE = 7,
3264 #[doc = "Free Balloon."]
3265 MAV_ODID_UA_TYPE_FREE_BALLOON = 8,
3266 #[doc = "Captive Balloon."]
3267 MAV_ODID_UA_TYPE_CAPTIVE_BALLOON = 9,
3268 #[doc = "Airship. E.g. a blimp."]
3269 MAV_ODID_UA_TYPE_AIRSHIP = 10,
3270 #[doc = "Free Fall/Parachute (unpowered)."]
3271 MAV_ODID_UA_TYPE_FREE_FALL_PARACHUTE = 11,
3272 #[doc = "Rocket."]
3273 MAV_ODID_UA_TYPE_ROCKET = 12,
3274 #[doc = "Tethered powered aircraft."]
3275 MAV_ODID_UA_TYPE_TETHERED_POWERED_AIRCRAFT = 13,
3276 #[doc = "Ground Obstacle."]
3277 MAV_ODID_UA_TYPE_GROUND_OBSTACLE = 14,
3278 #[doc = "Other type of aircraft not listed earlier."]
3279 MAV_ODID_UA_TYPE_OTHER = 15,
3280}
3281impl MavOdidUaType {
3282 pub const DEFAULT: Self = Self::MAV_ODID_UA_TYPE_NONE;
3283}
3284impl Default for MavOdidUaType {
3285 fn default() -> Self {
3286 Self::DEFAULT
3287 }
3288}
3289#[cfg_attr(feature = "ts", derive(TS))]
3290#[cfg_attr(feature = "ts", ts(export))]
3291#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3292#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3293#[cfg_attr(feature = "serde", serde(tag = "type"))]
3294#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3295#[repr(u32)]
3296pub enum MavOdidVerAcc {
3297 #[doc = "The vertical accuracy is unknown."]
3298 MAV_ODID_VER_ACC_UNKNOWN = 0,
3299 #[doc = "The vertical accuracy is smaller than 150 meter."]
3300 MAV_ODID_VER_ACC_150_METER = 1,
3301 #[doc = "The vertical accuracy is smaller than 45 meter."]
3302 MAV_ODID_VER_ACC_45_METER = 2,
3303 #[doc = "The vertical accuracy is smaller than 25 meter."]
3304 MAV_ODID_VER_ACC_25_METER = 3,
3305 #[doc = "The vertical accuracy is smaller than 10 meter."]
3306 MAV_ODID_VER_ACC_10_METER = 4,
3307 #[doc = "The vertical accuracy is smaller than 3 meter."]
3308 MAV_ODID_VER_ACC_3_METER = 5,
3309 #[doc = "The vertical accuracy is smaller than 1 meter."]
3310 MAV_ODID_VER_ACC_1_METER = 6,
3311}
3312impl MavOdidVerAcc {
3313 pub const DEFAULT: Self = Self::MAV_ODID_VER_ACC_UNKNOWN;
3314}
3315impl Default for MavOdidVerAcc {
3316 fn default() -> Self {
3317 Self::DEFAULT
3318 }
3319}
3320#[cfg_attr(feature = "ts", derive(TS))]
3321#[cfg_attr(feature = "ts", ts(export))]
3322#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3323#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3324#[cfg_attr(feature = "serde", serde(tag = "type"))]
3325#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3326#[repr(u32)]
3327#[doc = "Specifies the datatype of a MAVLink extended parameter."]
3328pub enum MavParamExtType {
3329 #[doc = "8-bit unsigned integer"]
3330 MAV_PARAM_EXT_TYPE_UINT8 = 1,
3331 #[doc = "8-bit signed integer"]
3332 MAV_PARAM_EXT_TYPE_INT8 = 2,
3333 #[doc = "16-bit unsigned integer"]
3334 MAV_PARAM_EXT_TYPE_UINT16 = 3,
3335 #[doc = "16-bit signed integer"]
3336 MAV_PARAM_EXT_TYPE_INT16 = 4,
3337 #[doc = "32-bit unsigned integer"]
3338 MAV_PARAM_EXT_TYPE_UINT32 = 5,
3339 #[doc = "32-bit signed integer"]
3340 MAV_PARAM_EXT_TYPE_INT32 = 6,
3341 #[doc = "64-bit unsigned integer"]
3342 MAV_PARAM_EXT_TYPE_UINT64 = 7,
3343 #[doc = "64-bit signed integer"]
3344 MAV_PARAM_EXT_TYPE_INT64 = 8,
3345 #[doc = "32-bit floating-point"]
3346 MAV_PARAM_EXT_TYPE_REAL32 = 9,
3347 #[doc = "64-bit floating-point"]
3348 MAV_PARAM_EXT_TYPE_REAL64 = 10,
3349 #[doc = "Custom Type"]
3350 MAV_PARAM_EXT_TYPE_CUSTOM = 11,
3351}
3352impl MavParamExtType {
3353 pub const DEFAULT: Self = Self::MAV_PARAM_EXT_TYPE_UINT8;
3354}
3355impl Default for MavParamExtType {
3356 fn default() -> Self {
3357 Self::DEFAULT
3358 }
3359}
3360#[cfg_attr(feature = "ts", derive(TS))]
3361#[cfg_attr(feature = "ts", ts(export))]
3362#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3363#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3364#[cfg_attr(feature = "serde", serde(tag = "type"))]
3365#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3366#[repr(u32)]
3367#[doc = "Specifies the datatype of a MAVLink parameter."]
3368pub enum MavParamType {
3369 #[doc = "8-bit unsigned integer"]
3370 MAV_PARAM_TYPE_UINT8 = 1,
3371 #[doc = "8-bit signed integer"]
3372 MAV_PARAM_TYPE_INT8 = 2,
3373 #[doc = "16-bit unsigned integer"]
3374 MAV_PARAM_TYPE_UINT16 = 3,
3375 #[doc = "16-bit signed integer"]
3376 MAV_PARAM_TYPE_INT16 = 4,
3377 #[doc = "32-bit unsigned integer"]
3378 MAV_PARAM_TYPE_UINT32 = 5,
3379 #[doc = "32-bit signed integer"]
3380 MAV_PARAM_TYPE_INT32 = 6,
3381 #[doc = "64-bit unsigned integer"]
3382 MAV_PARAM_TYPE_UINT64 = 7,
3383 #[doc = "64-bit signed integer"]
3384 MAV_PARAM_TYPE_INT64 = 8,
3385 #[doc = "32-bit floating-point"]
3386 MAV_PARAM_TYPE_REAL32 = 9,
3387 #[doc = "64-bit floating-point"]
3388 MAV_PARAM_TYPE_REAL64 = 10,
3389}
3390impl MavParamType {
3391 pub const DEFAULT: Self = Self::MAV_PARAM_TYPE_UINT8;
3392}
3393impl Default for MavParamType {
3394 fn default() -> Self {
3395 Self::DEFAULT
3396 }
3397}
3398bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Power supply status flags (bitmask)"] pub struct MavPowerStatus : u16 { # [doc = "main brick power supply valid"] const MAV_POWER_STATUS_BRICK_VALID = 1 ; # [doc = "main servo power supply valid for FMU"] const MAV_POWER_STATUS_SERVO_VALID = 2 ; # [doc = "USB power is connected"] const MAV_POWER_STATUS_USB_CONNECTED = 4 ; # [doc = "peripheral supply is in over-current state"] const MAV_POWER_STATUS_PERIPH_OVERCURRENT = 8 ; # [doc = "hi-power peripheral supply is in over-current state"] const MAV_POWER_STATUS_PERIPH_HIPOWER_OVERCURRENT = 16 ; # [doc = "Power status has changed since boot"] const MAV_POWER_STATUS_CHANGED = 32 ; } }
3399impl MavPowerStatus {
3400 pub const DEFAULT: Self = Self::MAV_POWER_STATUS_BRICK_VALID;
3401}
3402impl Default for MavPowerStatus {
3403 fn default() -> Self {
3404 Self::DEFAULT
3405 }
3406}
3407bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmask of (optional) autopilot capabilities (64 bit). If a bit is set, the autopilot supports this capability."] pub struct MavProtocolCapability : u64 { # [doc = "Autopilot supports the MISSION_ITEM float message type. Note that MISSION_ITEM is deprecated, and autopilots should use MISSION_INT instead."] const MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT = 1 ; # [deprecated = " See `MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST` (Deprecated since 2022-03)"] # [doc = "Autopilot supports the new param float message type."] const MAV_PROTOCOL_CAPABILITY_PARAM_FLOAT = 2 ; # [doc = "Autopilot supports MISSION_ITEM_INT scaled integer message type. Note that this flag must always be set if missions are supported, because missions must always use MISSION_ITEM_INT (rather than MISSION_ITEM, which is deprecated)."] const MAV_PROTOCOL_CAPABILITY_MISSION_INT = 4 ; # [doc = "Autopilot supports COMMAND_INT scaled integer message type."] const MAV_PROTOCOL_CAPABILITY_COMMAND_INT = 8 ; # [doc = "Parameter protocol uses byte-wise encoding of parameter values into param_value (float) fields: <https://mavlink.io/en/services/parameter.html#parameter-encoding>. Note that either this flag or MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST should be set if the parameter protocol is supported."] const MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_BYTEWISE = 16 ; # [doc = "Autopilot supports the File Transfer Protocol v1: <https://mavlink.io/en/services/ftp.html>."] const MAV_PROTOCOL_CAPABILITY_FTP = 32 ; # [doc = "Autopilot supports commanding attitude offboard."] const MAV_PROTOCOL_CAPABILITY_SET_ATTITUDE_TARGET = 64 ; # [doc = "Autopilot supports commanding position and velocity targets in local NED frame."] const MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_LOCAL_NED = 128 ; # [doc = "Autopilot supports commanding position and velocity targets in global scaled integers."] const MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_GLOBAL_INT = 256 ; # [doc = "Autopilot supports terrain protocol / data handling."] const MAV_PROTOCOL_CAPABILITY_TERRAIN = 512 ; # [doc = "Reserved for future use."] const MAV_PROTOCOL_CAPABILITY_RESERVED3 = 1024 ; # [doc = "Autopilot supports the MAV_CMD_DO_FLIGHTTERMINATION command (flight termination)."] const MAV_PROTOCOL_CAPABILITY_FLIGHT_TERMINATION = 2048 ; # [doc = "Autopilot supports onboard compass calibration."] const MAV_PROTOCOL_CAPABILITY_COMPASS_CALIBRATION = 4096 ; # [doc = "Autopilot supports MAVLink version 2."] const MAV_PROTOCOL_CAPABILITY_MAVLINK2 = 8192 ; # [doc = "Autopilot supports mission fence protocol."] const MAV_PROTOCOL_CAPABILITY_MISSION_FENCE = 16384 ; # [doc = "Autopilot supports mission rally point protocol."] const MAV_PROTOCOL_CAPABILITY_MISSION_RALLY = 32768 ; # [doc = "Reserved for future use."] const MAV_PROTOCOL_CAPABILITY_RESERVED2 = 65536 ; # [doc = "Parameter protocol uses C-cast of parameter values to set the param_value (float) fields: <https://mavlink.io/en/services/parameter.html#parameter-encoding>. Note that either this flag or MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_BYTEWISE should be set if the parameter protocol is supported."] const MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST = 131072 ; # [doc = "This component implements/is a gimbal manager. This means the GIMBAL_MANAGER_INFORMATION, and other messages can be requested."] const MAV_PROTOCOL_CAPABILITY_COMPONENT_IMPLEMENTS_GIMBAL_MANAGER = 262144 ; # [doc = "Component supports locking control to a particular GCS independent of its system (via MAV_CMD_REQUEST_OPERATOR_CONTROL)."] const MAV_PROTOCOL_CAPABILITY_COMPONENT_ACCEPTS_GCS_CONTROL = 524288 ; } }
3408impl MavProtocolCapability {
3409 pub const DEFAULT: Self = Self::MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT;
3410}
3411impl Default for MavProtocolCapability {
3412 fn default() -> Self {
3413 Self::DEFAULT
3414 }
3415}
3416#[cfg_attr(feature = "ts", derive(TS))]
3417#[cfg_attr(feature = "ts", ts(export))]
3418#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3419#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3420#[cfg_attr(feature = "serde", serde(tag = "type"))]
3421#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3422#[repr(u32)]
3423#[doc = "Result from a MAVLink command (MAV_CMD)"]
3424pub enum MavResult {
3425 #[doc = "Command is valid (is supported and has valid parameters), and was executed."]
3426 MAV_RESULT_ACCEPTED = 0,
3427 #[doc = "Command is valid, but cannot be executed at this time. This is used to indicate a problem that should be fixed just by waiting (e.g. a state machine is busy, can't arm because have not got GPS lock, etc.). Retrying later should work."]
3428 MAV_RESULT_TEMPORARILY_REJECTED = 1,
3429 #[doc = "Command is invalid (is supported but has invalid parameters). Retrying same command and parameters will not work."]
3430 MAV_RESULT_DENIED = 2,
3431 #[doc = "Command is not supported (unknown)."]
3432 MAV_RESULT_UNSUPPORTED = 3,
3433 #[doc = "Command is valid, but execution has failed. This is used to indicate any non-temporary or unexpected problem, i.e. any problem that must be fixed before the command can succeed/be retried. For example, attempting to write a file when out of memory, attempting to arm when sensors are not calibrated, etc."]
3434 MAV_RESULT_FAILED = 4,
3435 #[doc = "Command is valid and is being executed. This will be followed by further progress updates, i.e. the component may send further COMMAND_ACK messages with result MAV_RESULT_IN_PROGRESS (at a rate decided by the implementation), and must terminate by sending a COMMAND_ACK message with final result of the operation. The COMMAND_ACK.progress field can be used to indicate the progress of the operation."]
3436 MAV_RESULT_IN_PROGRESS = 5,
3437 #[doc = "Command has been cancelled (as a result of receiving a COMMAND_CANCEL message)."]
3438 MAV_RESULT_CANCELLED = 6,
3439 #[doc = "Command is only accepted when sent as a COMMAND_LONG."]
3440 MAV_RESULT_COMMAND_LONG_ONLY = 7,
3441 #[doc = "Command is only accepted when sent as a COMMAND_INT."]
3442 MAV_RESULT_COMMAND_INT_ONLY = 8,
3443 #[doc = "Command is invalid because a frame is required and the specified frame is not supported."]
3444 MAV_RESULT_COMMAND_UNSUPPORTED_MAV_FRAME = 9,
3445}
3446impl MavResult {
3447 pub const DEFAULT: Self = Self::MAV_RESULT_ACCEPTED;
3448}
3449impl Default for MavResult {
3450 fn default() -> Self {
3451 Self::DEFAULT
3452 }
3453}
3454#[cfg_attr(feature = "ts", derive(TS))]
3455#[cfg_attr(feature = "ts", ts(export))]
3456#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3457#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3458#[cfg_attr(feature = "serde", serde(tag = "type"))]
3459#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3460#[repr(u32)]
3461#[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
3462#[doc = "The ROI (region of interest) for the vehicle. This can be be used by the vehicle for camera/vehicle attitude alignment (see MAV_CMD_NAV_ROI)."]
3463pub enum MavRoi {
3464 #[doc = "No region of interest."]
3465 MAV_ROI_NONE = 0,
3466 #[doc = "Point toward next waypoint, with optional pitch/roll/yaw offset."]
3467 MAV_ROI_WPNEXT = 1,
3468 #[doc = "Point toward given waypoint."]
3469 MAV_ROI_WPINDEX = 2,
3470 #[doc = "Point toward fixed location."]
3471 MAV_ROI_LOCATION = 3,
3472 #[doc = "Point toward of given id."]
3473 MAV_ROI_TARGET = 4,
3474}
3475impl MavRoi {
3476 pub const DEFAULT: Self = Self::MAV_ROI_NONE;
3477}
3478impl Default for MavRoi {
3479 fn default() -> Self {
3480 Self::DEFAULT
3481 }
3482}
3483#[cfg_attr(feature = "ts", derive(TS))]
3484#[cfg_attr(feature = "ts", ts(export))]
3485#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3486#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3487#[cfg_attr(feature = "serde", serde(tag = "type"))]
3488#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3489#[repr(u32)]
3490#[doc = "Enumeration of sensor orientation, according to its rotations"]
3491pub enum MavSensorOrientation {
3492 #[doc = "Roll: 0, Pitch: 0, Yaw: 0"]
3493 MAV_SENSOR_ROTATION_NONE = 0,
3494 #[doc = "Roll: 0, Pitch: 0, Yaw: 45"]
3495 MAV_SENSOR_ROTATION_YAW_45 = 1,
3496 #[doc = "Roll: 0, Pitch: 0, Yaw: 90"]
3497 MAV_SENSOR_ROTATION_YAW_90 = 2,
3498 #[doc = "Roll: 0, Pitch: 0, Yaw: 135"]
3499 MAV_SENSOR_ROTATION_YAW_135 = 3,
3500 #[doc = "Roll: 0, Pitch: 0, Yaw: 180"]
3501 MAV_SENSOR_ROTATION_YAW_180 = 4,
3502 #[doc = "Roll: 0, Pitch: 0, Yaw: 225"]
3503 MAV_SENSOR_ROTATION_YAW_225 = 5,
3504 #[doc = "Roll: 0, Pitch: 0, Yaw: 270"]
3505 MAV_SENSOR_ROTATION_YAW_270 = 6,
3506 #[doc = "Roll: 0, Pitch: 0, Yaw: 315"]
3507 MAV_SENSOR_ROTATION_YAW_315 = 7,
3508 #[doc = "Roll: 180, Pitch: 0, Yaw: 0"]
3509 MAV_SENSOR_ROTATION_ROLL_180 = 8,
3510 #[doc = "Roll: 180, Pitch: 0, Yaw: 45"]
3511 MAV_SENSOR_ROTATION_ROLL_180_YAW_45 = 9,
3512 #[doc = "Roll: 180, Pitch: 0, Yaw: 90"]
3513 MAV_SENSOR_ROTATION_ROLL_180_YAW_90 = 10,
3514 #[doc = "Roll: 180, Pitch: 0, Yaw: 135"]
3515 MAV_SENSOR_ROTATION_ROLL_180_YAW_135 = 11,
3516 #[doc = "Roll: 0, Pitch: 180, Yaw: 0"]
3517 MAV_SENSOR_ROTATION_PITCH_180 = 12,
3518 #[doc = "Roll: 180, Pitch: 0, Yaw: 225"]
3519 MAV_SENSOR_ROTATION_ROLL_180_YAW_225 = 13,
3520 #[doc = "Roll: 180, Pitch: 0, Yaw: 270"]
3521 MAV_SENSOR_ROTATION_ROLL_180_YAW_270 = 14,
3522 #[doc = "Roll: 180, Pitch: 0, Yaw: 315"]
3523 MAV_SENSOR_ROTATION_ROLL_180_YAW_315 = 15,
3524 #[doc = "Roll: 90, Pitch: 0, Yaw: 0"]
3525 MAV_SENSOR_ROTATION_ROLL_90 = 16,
3526 #[doc = "Roll: 90, Pitch: 0, Yaw: 45"]
3527 MAV_SENSOR_ROTATION_ROLL_90_YAW_45 = 17,
3528 #[doc = "Roll: 90, Pitch: 0, Yaw: 90"]
3529 MAV_SENSOR_ROTATION_ROLL_90_YAW_90 = 18,
3530 #[doc = "Roll: 90, Pitch: 0, Yaw: 135"]
3531 MAV_SENSOR_ROTATION_ROLL_90_YAW_135 = 19,
3532 #[doc = "Roll: 270, Pitch: 0, Yaw: 0"]
3533 MAV_SENSOR_ROTATION_ROLL_270 = 20,
3534 #[doc = "Roll: 270, Pitch: 0, Yaw: 45"]
3535 MAV_SENSOR_ROTATION_ROLL_270_YAW_45 = 21,
3536 #[doc = "Roll: 270, Pitch: 0, Yaw: 90"]
3537 MAV_SENSOR_ROTATION_ROLL_270_YAW_90 = 22,
3538 #[doc = "Roll: 270, Pitch: 0, Yaw: 135"]
3539 MAV_SENSOR_ROTATION_ROLL_270_YAW_135 = 23,
3540 #[doc = "Roll: 0, Pitch: 90, Yaw: 0"]
3541 MAV_SENSOR_ROTATION_PITCH_90 = 24,
3542 #[doc = "Roll: 0, Pitch: 270, Yaw: 0"]
3543 MAV_SENSOR_ROTATION_PITCH_270 = 25,
3544 #[doc = "Roll: 0, Pitch: 180, Yaw: 90"]
3545 MAV_SENSOR_ROTATION_PITCH_180_YAW_90 = 26,
3546 #[doc = "Roll: 0, Pitch: 180, Yaw: 270"]
3547 MAV_SENSOR_ROTATION_PITCH_180_YAW_270 = 27,
3548 #[doc = "Roll: 90, Pitch: 90, Yaw: 0"]
3549 MAV_SENSOR_ROTATION_ROLL_90_PITCH_90 = 28,
3550 #[doc = "Roll: 180, Pitch: 90, Yaw: 0"]
3551 MAV_SENSOR_ROTATION_ROLL_180_PITCH_90 = 29,
3552 #[doc = "Roll: 270, Pitch: 90, Yaw: 0"]
3553 MAV_SENSOR_ROTATION_ROLL_270_PITCH_90 = 30,
3554 #[doc = "Roll: 90, Pitch: 180, Yaw: 0"]
3555 MAV_SENSOR_ROTATION_ROLL_90_PITCH_180 = 31,
3556 #[doc = "Roll: 270, Pitch: 180, Yaw: 0"]
3557 MAV_SENSOR_ROTATION_ROLL_270_PITCH_180 = 32,
3558 #[doc = "Roll: 90, Pitch: 270, Yaw: 0"]
3559 MAV_SENSOR_ROTATION_ROLL_90_PITCH_270 = 33,
3560 #[doc = "Roll: 180, Pitch: 270, Yaw: 0"]
3561 MAV_SENSOR_ROTATION_ROLL_180_PITCH_270 = 34,
3562 #[doc = "Roll: 270, Pitch: 270, Yaw: 0"]
3563 MAV_SENSOR_ROTATION_ROLL_270_PITCH_270 = 35,
3564 #[doc = "Roll: 90, Pitch: 180, Yaw: 90"]
3565 MAV_SENSOR_ROTATION_ROLL_90_PITCH_180_YAW_90 = 36,
3566 #[doc = "Roll: 90, Pitch: 0, Yaw: 270"]
3567 MAV_SENSOR_ROTATION_ROLL_90_YAW_270 = 37,
3568 #[doc = "Roll: 90, Pitch: 68, Yaw: 293"]
3569 MAV_SENSOR_ROTATION_ROLL_90_PITCH_68_YAW_293 = 38,
3570 #[doc = "Pitch: 315"]
3571 MAV_SENSOR_ROTATION_PITCH_315 = 39,
3572 #[doc = "Roll: 90, Pitch: 315"]
3573 MAV_SENSOR_ROTATION_ROLL_90_PITCH_315 = 40,
3574 #[doc = "Custom orientation"]
3575 MAV_SENSOR_ROTATION_CUSTOM = 100,
3576}
3577impl MavSensorOrientation {
3578 pub const DEFAULT: Self = Self::MAV_SENSOR_ROTATION_NONE;
3579}
3580impl Default for MavSensorOrientation {
3581 fn default() -> Self {
3582 Self::DEFAULT
3583 }
3584}
3585#[cfg_attr(feature = "ts", derive(TS))]
3586#[cfg_attr(feature = "ts", ts(export))]
3587#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3588#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3589#[cfg_attr(feature = "serde", serde(tag = "type"))]
3590#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3591#[repr(u32)]
3592#[doc = "Indicates the severity level, generally used for status messages to indicate their relative urgency. Based on RFC-5424 using expanded definitions at: <http://www.kiwisyslog.com/kb/info:-syslog-message-levels/>."]
3593pub enum MavSeverity {
3594 #[doc = "System is unusable. This is a \"panic\" condition."]
3595 MAV_SEVERITY_EMERGENCY = 0,
3596 #[doc = "Action should be taken immediately. Indicates error in non-critical systems."]
3597 MAV_SEVERITY_ALERT = 1,
3598 #[doc = "Action must be taken immediately. Indicates failure in a primary system."]
3599 MAV_SEVERITY_CRITICAL = 2,
3600 #[doc = "Indicates an error in secondary/redundant systems."]
3601 MAV_SEVERITY_ERROR = 3,
3602 #[doc = "Indicates about a possible future error if this is not resolved within a given timeframe. Example would be a low battery warning."]
3603 MAV_SEVERITY_WARNING = 4,
3604 #[doc = "An unusual event has occurred, though not an error condition. This should be investigated for the root cause."]
3605 MAV_SEVERITY_NOTICE = 5,
3606 #[doc = "Normal operational messages. Useful for logging. No action is required for these messages."]
3607 MAV_SEVERITY_INFO = 6,
3608 #[doc = "Useful non-operational messages that can assist in debugging. These should not occur during normal operation."]
3609 MAV_SEVERITY_DEBUG = 7,
3610}
3611impl MavSeverity {
3612 pub const DEFAULT: Self = Self::MAV_SEVERITY_EMERGENCY;
3613}
3614impl Default for MavSeverity {
3615 fn default() -> Self {
3616 Self::DEFAULT
3617 }
3618}
3619#[cfg_attr(feature = "ts", derive(TS))]
3620#[cfg_attr(feature = "ts", ts(export))]
3621#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3622#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3623#[cfg_attr(feature = "serde", serde(tag = "type"))]
3624#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3625#[repr(u32)]
3626#[doc = "Standard modes with a well understood meaning across flight stacks and vehicle types. For example, most flight stack have the concept of a \"return\" or \"RTL\" mode that takes a vehicle to safety, even though the precise mechanics of this mode may differ. The modes supported by a flight stack can be queried using AVAILABLE_MODES and set using MAV_CMD_DO_SET_STANDARD_MODE. The current mode is streamed in CURRENT_MODE. See <https://mavlink.io/en/services/standard_modes.html>"]
3627pub enum MavStandardMode {
3628 #[doc = "Non standard mode. This may be used when reporting the mode if the current flight mode is not a standard mode."]
3629 MAV_STANDARD_MODE_NON_STANDARD = 0,
3630 #[doc = "Position mode (manual). Position-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold both position and altitude against wind and external forces. This mode can only be set by vehicles that can hold a fixed position. Multicopter (MC) vehicles actively brake and hold both position and altitude against wind and external forces. Hybrid MC/FW (\"VTOL\") vehicles first transition to multicopter mode (if needed) but otherwise behave in the same way as MC vehicles. Fixed-wing (FW) vehicles must not support this mode. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3631 MAV_STANDARD_MODE_POSITION_HOLD = 1,
3632 #[doc = "Orbit (manual). Position-controlled and stabilized manual mode. The vehicle circles around a fixed setpoint in the horizontal plane at a particular radius, altitude, and direction. Flight stacks may further allow manual control over the setpoint position, radius, direction, speed, and/or altitude of the circle, but this is not mandated. Flight stacks may support the [MAV_CMD_DO_ORBIT](<https://mavlink.io/en/messages/common.html#MAV_CMD_DO_ORBIT>) for changing the orbit parameters. MC and FW vehicles may support this mode. Hybrid MC/FW (\"VTOL\") vehicles may support this mode in MC/FW or both modes; if the mode is not supported by the current configuration the vehicle should transition to the supported configuration. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3633 MAV_STANDARD_MODE_ORBIT = 2,
3634 #[doc = "Cruise mode (manual). Position-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold their original track against wind and external forces. Fixed-wing (FW) vehicles level orientation and maintain current track and altitude against wind and external forces. Hybrid MC/FW (\"VTOL\") vehicles first transition to FW mode (if needed) but otherwise behave in the same way as MC vehicles. Multicopter (MC) vehicles must not support this mode. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3635 MAV_STANDARD_MODE_CRUISE = 3,
3636 #[doc = "Altitude hold (manual). Altitude-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold their altitude. MC vehicles continue with existing momentum and may move with wind (or other external forces). FW vehicles continue with current heading, but may be moved off-track by wind. Hybrid MC/FW (\"VTOL\") vehicles behave according to their current configuration/mode (FW or MC). Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3637 MAV_STANDARD_MODE_ALTITUDE_HOLD = 4,
3638 #[doc = "Safe recovery mode (auto). Automatic mode that takes vehicle to a predefined safe location via a safe flight path, and may also automatically land the vehicle. This mode is more commonly referred to as RTL and/or or Smart RTL. The precise return location, flight path, and landing behaviour depend on vehicle configuration and type. For example, the vehicle might return to the home/launch location, a rally point, or the start of a mission landing, it might follow a direct path, mission path, or breadcrumb path, and land using a mission landing pattern or some other kind of descent."]
3639 MAV_STANDARD_MODE_SAFE_RECOVERY = 5,
3640 #[doc = "Mission mode (automatic). Automatic mode that executes MAVLink missions. Missions are executed from the current waypoint as soon as the mode is enabled."]
3641 MAV_STANDARD_MODE_MISSION = 6,
3642 #[doc = "Land mode (auto). Automatic mode that lands the vehicle at the current location. The precise landing behaviour depends on vehicle configuration and type."]
3643 MAV_STANDARD_MODE_LAND = 7,
3644 #[doc = "Takeoff mode (auto). Automatic takeoff mode. The precise takeoff behaviour depends on vehicle configuration and type."]
3645 MAV_STANDARD_MODE_TAKEOFF = 8,
3646}
3647impl MavStandardMode {
3648 pub const DEFAULT: Self = Self::MAV_STANDARD_MODE_NON_STANDARD;
3649}
3650impl Default for MavStandardMode {
3651 fn default() -> Self {
3652 Self::DEFAULT
3653 }
3654}
3655#[cfg_attr(feature = "ts", derive(TS))]
3656#[cfg_attr(feature = "ts", ts(export))]
3657#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3658#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3659#[cfg_attr(feature = "serde", serde(tag = "type"))]
3660#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3661#[repr(u32)]
3662pub enum MavState {
3663 #[doc = "Uninitialized system, state is unknown."]
3664 MAV_STATE_UNINIT = 0,
3665 #[doc = "System is booting up."]
3666 MAV_STATE_BOOT = 1,
3667 #[doc = "System is calibrating and not flight-ready."]
3668 MAV_STATE_CALIBRATING = 2,
3669 #[doc = "System is grounded and on standby. It can be launched any time."]
3670 MAV_STATE_STANDBY = 3,
3671 #[doc = "System is active and might be already airborne. Motors are engaged."]
3672 MAV_STATE_ACTIVE = 4,
3673 #[doc = "System is in a non-normal flight mode (failsafe). It can however still navigate."]
3674 MAV_STATE_CRITICAL = 5,
3675 #[doc = "System is in a non-normal flight mode (failsafe). It lost control over parts or over the whole airframe. It is in mayday and going down."]
3676 MAV_STATE_EMERGENCY = 6,
3677 #[doc = "System just initialized its power-down sequence, will shut down now."]
3678 MAV_STATE_POWEROFF = 7,
3679 #[doc = "System is terminating itself (failsafe or commanded)."]
3680 MAV_STATE_FLIGHT_TERMINATION = 8,
3681}
3682impl MavState {
3683 pub const DEFAULT: Self = Self::MAV_STATE_UNINIT;
3684}
3685impl Default for MavState {
3686 fn default() -> Self {
3687 Self::DEFAULT
3688 }
3689}
3690bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These encode the sensors whose status is sent as part of the SYS_STATUS message."] pub struct MavSysStatusSensor : u32 { # [doc = "0x01 3D gyro"] const MAV_SYS_STATUS_SENSOR_3D_GYRO = 1 ; # [doc = "0x02 3D accelerometer"] const MAV_SYS_STATUS_SENSOR_3D_ACCEL = 2 ; # [doc = "0x04 3D magnetometer"] const MAV_SYS_STATUS_SENSOR_3D_MAG = 4 ; # [doc = "0x08 absolute pressure"] const MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE = 8 ; # [doc = "0x10 differential pressure"] const MAV_SYS_STATUS_SENSOR_DIFFERENTIAL_PRESSURE = 16 ; # [doc = "0x20 GPS"] const MAV_SYS_STATUS_SENSOR_GPS = 32 ; # [doc = "0x40 optical flow"] const MAV_SYS_STATUS_SENSOR_OPTICAL_FLOW = 64 ; # [doc = "0x80 computer vision position"] const MAV_SYS_STATUS_SENSOR_VISION_POSITION = 128 ; # [doc = "0x100 laser based position"] const MAV_SYS_STATUS_SENSOR_LASER_POSITION = 256 ; # [doc = "0x200 external ground truth (Vicon or Leica)"] const MAV_SYS_STATUS_SENSOR_EXTERNAL_GROUND_TRUTH = 512 ; # [doc = "0x400 3D angular rate control"] const MAV_SYS_STATUS_SENSOR_ANGULAR_RATE_CONTROL = 1024 ; # [doc = "0x800 attitude stabilization"] const MAV_SYS_STATUS_SENSOR_ATTITUDE_STABILIZATION = 2048 ; # [doc = "0x1000 yaw position"] const MAV_SYS_STATUS_SENSOR_YAW_POSITION = 4096 ; # [doc = "0x2000 z/altitude control"] const MAV_SYS_STATUS_SENSOR_Z_ALTITUDE_CONTROL = 8192 ; # [doc = "0x4000 x/y position control"] const MAV_SYS_STATUS_SENSOR_XY_POSITION_CONTROL = 16384 ; # [doc = "0x8000 motor outputs / control"] const MAV_SYS_STATUS_SENSOR_MOTOR_OUTPUTS = 32768 ; # [doc = "0x10000 RC receiver"] const MAV_SYS_STATUS_SENSOR_RC_RECEIVER = 65536 ; # [doc = "0x20000 2nd 3D gyro"] const MAV_SYS_STATUS_SENSOR_3D_GYRO2 = 131072 ; # [doc = "0x40000 2nd 3D accelerometer"] const MAV_SYS_STATUS_SENSOR_3D_ACCEL2 = 262144 ; # [doc = "0x80000 2nd 3D magnetometer"] const MAV_SYS_STATUS_SENSOR_3D_MAG2 = 524288 ; # [doc = "0x100000 geofence"] const MAV_SYS_STATUS_GEOFENCE = 1048576 ; # [doc = "0x200000 AHRS subsystem health"] const MAV_SYS_STATUS_AHRS = 2097152 ; # [doc = "0x400000 Terrain subsystem health"] const MAV_SYS_STATUS_TERRAIN = 4194304 ; # [doc = "0x800000 Motors are reversed"] const MAV_SYS_STATUS_REVERSE_MOTOR = 8388608 ; # [doc = "0x1000000 Logging"] const MAV_SYS_STATUS_LOGGING = 16777216 ; # [doc = "0x2000000 Battery"] const MAV_SYS_STATUS_SENSOR_BATTERY = 33554432 ; # [doc = "0x4000000 Proximity"] const MAV_SYS_STATUS_SENSOR_PROXIMITY = 67108864 ; # [doc = "0x8000000 Satellite Communication"] const MAV_SYS_STATUS_SENSOR_SATCOM = 134217728 ; # [doc = "0x10000000 pre-arm check status. Always healthy when armed"] const MAV_SYS_STATUS_PREARM_CHECK = 268435456 ; # [doc = "0x20000000 Avoidance/collision prevention"] const MAV_SYS_STATUS_OBSTACLE_AVOIDANCE = 536870912 ; # [doc = "0x40000000 propulsion (actuator, esc, motor or propellor)"] const MAV_SYS_STATUS_SENSOR_PROPULSION = 1073741824 ; # [doc = "0x80000000 Extended bit-field are used for further sensor status bits (needs to be set in onboard_control_sensors_present only)"] const MAV_SYS_STATUS_EXTENSION_USED = 2147483648 ; } }
3691impl MavSysStatusSensor {
3692 pub const DEFAULT: Self = Self::MAV_SYS_STATUS_SENSOR_3D_GYRO;
3693}
3694impl Default for MavSysStatusSensor {
3695 fn default() -> Self {
3696 Self::DEFAULT
3697 }
3698}
3699bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These encode the sensors whose status is sent as part of the SYS_STATUS message in the extended fields."] pub struct MavSysStatusSensorExtended : u32 { # [doc = "0x01 Recovery system (parachute, balloon, retracts etc)"] const MAV_SYS_STATUS_RECOVERY_SYSTEM = 1 ; } }
3700impl MavSysStatusSensorExtended {
3701 pub const DEFAULT: Self = Self::MAV_SYS_STATUS_RECOVERY_SYSTEM;
3702}
3703impl Default for MavSysStatusSensorExtended {
3704 fn default() -> Self {
3705 Self::DEFAULT
3706 }
3707}
3708#[cfg_attr(feature = "ts", derive(TS))]
3709#[cfg_attr(feature = "ts", ts(export))]
3710#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3711#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3712#[cfg_attr(feature = "serde", serde(tag = "type"))]
3713#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3714#[repr(u32)]
3715pub enum MavTunnelPayloadType {
3716 #[doc = "Encoding of payload unknown."]
3717 MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN = 0,
3718 #[doc = "Registered for STorM32 gimbal controller."]
3719 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED0 = 200,
3720 #[doc = "Registered for STorM32 gimbal controller."]
3721 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED1 = 201,
3722 #[doc = "Registered for STorM32 gimbal controller."]
3723 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED2 = 202,
3724 #[doc = "Registered for STorM32 gimbal controller."]
3725 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED3 = 203,
3726 #[doc = "Registered for STorM32 gimbal controller."]
3727 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED4 = 204,
3728 #[doc = "Registered for STorM32 gimbal controller."]
3729 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED5 = 205,
3730 #[doc = "Registered for STorM32 gimbal controller."]
3731 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED6 = 206,
3732 #[doc = "Registered for STorM32 gimbal controller."]
3733 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED7 = 207,
3734 #[doc = "Registered for STorM32 gimbal controller."]
3735 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED8 = 208,
3736 #[doc = "Registered for STorM32 gimbal controller."]
3737 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED9 = 209,
3738 #[doc = "Registered for ModalAI remote OSD protocol."]
3739 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_REMOTE_OSD = 210,
3740 #[doc = "Registered for ModalAI ESC UART passthru protocol."]
3741 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_ESC_UART_PASSTHRU = 211,
3742 #[doc = "Registered for ModalAI vendor use."]
3743 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_IO_UART_PASSTHRU = 212,
3744}
3745impl MavTunnelPayloadType {
3746 pub const DEFAULT: Self = Self::MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN;
3747}
3748impl Default for MavTunnelPayloadType {
3749 fn default() -> Self {
3750 Self::DEFAULT
3751 }
3752}
3753#[cfg_attr(feature = "ts", derive(TS))]
3754#[cfg_attr(feature = "ts", ts(export))]
3755#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3756#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3757#[cfg_attr(feature = "serde", serde(tag = "type"))]
3758#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3759#[repr(u32)]
3760#[doc = "MAVLINK component type reported in HEARTBEAT message. Flight controllers must report the type of the vehicle on which they are mounted (e.g. MAV_TYPE_OCTOROTOR). All other components must report a value appropriate for their type (e.g. a camera must use MAV_TYPE_CAMERA)."]
3761pub enum MavType {
3762 #[doc = "Generic micro air vehicle"]
3763 MAV_TYPE_GENERIC = 0,
3764 #[doc = "Fixed wing aircraft."]
3765 MAV_TYPE_FIXED_WING = 1,
3766 #[doc = "Quadrotor"]
3767 MAV_TYPE_QUADROTOR = 2,
3768 #[doc = "Coaxial helicopter"]
3769 MAV_TYPE_COAXIAL = 3,
3770 #[doc = "Normal helicopter with tail rotor."]
3771 MAV_TYPE_HELICOPTER = 4,
3772 #[doc = "Ground installation"]
3773 MAV_TYPE_ANTENNA_TRACKER = 5,
3774 #[doc = "Operator control unit / ground control station"]
3775 MAV_TYPE_GCS = 6,
3776 #[doc = "Airship, controlled"]
3777 MAV_TYPE_AIRSHIP = 7,
3778 #[doc = "Free balloon, uncontrolled"]
3779 MAV_TYPE_FREE_BALLOON = 8,
3780 #[doc = "Rocket"]
3781 MAV_TYPE_ROCKET = 9,
3782 #[doc = "Ground rover"]
3783 MAV_TYPE_GROUND_ROVER = 10,
3784 #[doc = "Surface vessel, boat, ship"]
3785 MAV_TYPE_SURFACE_BOAT = 11,
3786 #[doc = "Submarine"]
3787 MAV_TYPE_SUBMARINE = 12,
3788 #[doc = "Hexarotor"]
3789 MAV_TYPE_HEXAROTOR = 13,
3790 #[doc = "Octorotor"]
3791 MAV_TYPE_OCTOROTOR = 14,
3792 #[doc = "Tricopter"]
3793 MAV_TYPE_TRICOPTER = 15,
3794 #[doc = "Flapping wing"]
3795 MAV_TYPE_FLAPPING_WING = 16,
3796 #[doc = "Kite"]
3797 MAV_TYPE_KITE = 17,
3798 #[doc = "Onboard companion controller"]
3799 MAV_TYPE_ONBOARD_CONTROLLER = 18,
3800 #[doc = "Two-rotor Tailsitter VTOL that additionally uses control surfaces in vertical operation. Note, value previously named MAV_TYPE_VTOL_DUOROTOR."]
3801 MAV_TYPE_VTOL_TAILSITTER_DUOROTOR = 19,
3802 #[doc = "Quad-rotor Tailsitter VTOL using a V-shaped quad config in vertical operation. Note: value previously named MAV_TYPE_VTOL_QUADROTOR."]
3803 MAV_TYPE_VTOL_TAILSITTER_QUADROTOR = 20,
3804 #[doc = "Tiltrotor VTOL. Fuselage and wings stay (nominally) horizontal in all flight phases. It able to tilt (some) rotors to provide thrust in cruise flight."]
3805 MAV_TYPE_VTOL_TILTROTOR = 21,
3806 #[doc = "VTOL with separate fixed rotors for hover and cruise flight. Fuselage and wings stay (nominally) horizontal in all flight phases."]
3807 MAV_TYPE_VTOL_FIXEDROTOR = 22,
3808 #[doc = "Tailsitter VTOL. Fuselage and wings orientation changes depending on flight phase: vertical for hover, horizontal for cruise. Use more specific VTOL MAV_TYPE_VTOL_TAILSITTER_DUOROTOR or MAV_TYPE_VTOL_TAILSITTER_QUADROTOR if appropriate."]
3809 MAV_TYPE_VTOL_TAILSITTER = 23,
3810 #[doc = "Tiltwing VTOL. Fuselage stays horizontal in all flight phases. The whole wing, along with any attached engine, can tilt between vertical and horizontal mode."]
3811 MAV_TYPE_VTOL_TILTWING = 24,
3812 #[doc = "VTOL reserved 5"]
3813 MAV_TYPE_VTOL_RESERVED5 = 25,
3814 #[doc = "Gimbal"]
3815 MAV_TYPE_GIMBAL = 26,
3816 #[doc = "ADSB system"]
3817 MAV_TYPE_ADSB = 27,
3818 #[doc = "Steerable, nonrigid airfoil"]
3819 MAV_TYPE_PARAFOIL = 28,
3820 #[doc = "Dodecarotor"]
3821 MAV_TYPE_DODECAROTOR = 29,
3822 #[doc = "Camera"]
3823 MAV_TYPE_CAMERA = 30,
3824 #[doc = "Charging station"]
3825 MAV_TYPE_CHARGING_STATION = 31,
3826 #[doc = "FLARM collision avoidance system"]
3827 MAV_TYPE_FLARM = 32,
3828 #[doc = "Servo"]
3829 MAV_TYPE_SERVO = 33,
3830 #[doc = "Open Drone ID. See <https://mavlink.io/en/services/opendroneid.html>."]
3831 MAV_TYPE_ODID = 34,
3832 #[doc = "Decarotor"]
3833 MAV_TYPE_DECAROTOR = 35,
3834 #[doc = "Battery"]
3835 MAV_TYPE_BATTERY = 36,
3836 #[doc = "Parachute"]
3837 MAV_TYPE_PARACHUTE = 37,
3838 #[doc = "Log"]
3839 MAV_TYPE_LOG = 38,
3840 #[doc = "OSD"]
3841 MAV_TYPE_OSD = 39,
3842 #[doc = "IMU"]
3843 MAV_TYPE_IMU = 40,
3844 #[doc = "GPS"]
3845 MAV_TYPE_GPS = 41,
3846 #[doc = "Winch"]
3847 MAV_TYPE_WINCH = 42,
3848 #[doc = "Generic multirotor that does not fit into a specific type or whose type is unknown"]
3849 MAV_TYPE_GENERIC_MULTIROTOR = 43,
3850 #[doc = "Illuminator. An illuminator is a light source that is used for lighting up dark areas external to the sytstem: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
3851 MAV_TYPE_ILLUMINATOR = 44,
3852 #[doc = "Orbiter spacecraft. Includes satellites orbiting terrestrial and extra-terrestrial bodies. Follows NASA Spacecraft Classification."]
3853 MAV_TYPE_SPACECRAFT_ORBITER = 45,
3854}
3855impl MavType {
3856 pub const DEFAULT: Self = Self::MAV_TYPE_GENERIC;
3857}
3858impl Default for MavType {
3859 fn default() -> Self {
3860 Self::DEFAULT
3861 }
3862}
3863#[cfg_attr(feature = "ts", derive(TS))]
3864#[cfg_attr(feature = "ts", ts(export))]
3865#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3866#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3867#[cfg_attr(feature = "serde", serde(tag = "type"))]
3868#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3869#[repr(u32)]
3870#[doc = "Enumeration of VTOL states"]
3871pub enum MavVtolState {
3872 #[doc = "MAV is not configured as VTOL"]
3873 MAV_VTOL_STATE_UNDEFINED = 0,
3874 #[doc = "VTOL is in transition from multicopter to fixed-wing"]
3875 MAV_VTOL_STATE_TRANSITION_TO_FW = 1,
3876 #[doc = "VTOL is in transition from fixed-wing to multicopter"]
3877 MAV_VTOL_STATE_TRANSITION_TO_MC = 2,
3878 #[doc = "VTOL is in multicopter state"]
3879 MAV_VTOL_STATE_MC = 3,
3880 #[doc = "VTOL is in fixed-wing state"]
3881 MAV_VTOL_STATE_FW = 4,
3882}
3883impl MavVtolState {
3884 pub const DEFAULT: Self = Self::MAV_VTOL_STATE_UNDEFINED;
3885}
3886impl Default for MavVtolState {
3887 fn default() -> Self {
3888 Self::DEFAULT
3889 }
3890}
3891bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Winch status flags used in WINCH_STATUS"] pub struct MavWinchStatusFlag : u32 { # [doc = "Winch is healthy"] const MAV_WINCH_STATUS_HEALTHY = 1 ; # [doc = "Winch line is fully retracted"] const MAV_WINCH_STATUS_FULLY_RETRACTED = 2 ; # [doc = "Winch motor is moving"] const MAV_WINCH_STATUS_MOVING = 4 ; # [doc = "Winch clutch is engaged allowing motor to move freely."] const MAV_WINCH_STATUS_CLUTCH_ENGAGED = 8 ; # [doc = "Winch is locked by locking mechanism."] const MAV_WINCH_STATUS_LOCKED = 16 ; # [doc = "Winch is gravity dropping payload."] const MAV_WINCH_STATUS_DROPPING = 32 ; # [doc = "Winch is arresting payload descent."] const MAV_WINCH_STATUS_ARRESTING = 64 ; # [doc = "Winch is using torque measurements to sense the ground."] const MAV_WINCH_STATUS_GROUND_SENSE = 128 ; # [doc = "Winch is returning to the fully retracted position."] const MAV_WINCH_STATUS_RETRACTING = 256 ; # [doc = "Winch is redelivering the payload. This is a failover state if the line tension goes above a threshold during RETRACTING."] const MAV_WINCH_STATUS_REDELIVER = 512 ; # [doc = "Winch is abandoning the line and possibly payload. Winch unspools the entire calculated line length. This is a failover state from REDELIVER if the number of attempts exceeds a threshold."] const MAV_WINCH_STATUS_ABANDON_LINE = 1024 ; # [doc = "Winch is engaging the locking mechanism."] const MAV_WINCH_STATUS_LOCKING = 2048 ; # [doc = "Winch is spooling on line."] const MAV_WINCH_STATUS_LOAD_LINE = 4096 ; # [doc = "Winch is loading a payload."] const MAV_WINCH_STATUS_LOAD_PAYLOAD = 8192 ; } }
3892impl MavWinchStatusFlag {
3893 pub const DEFAULT: Self = Self::MAV_WINCH_STATUS_HEALTHY;
3894}
3895impl Default for MavWinchStatusFlag {
3896 fn default() -> Self {
3897 Self::DEFAULT
3898 }
3899}
3900#[cfg_attr(feature = "ts", derive(TS))]
3901#[cfg_attr(feature = "ts", ts(export))]
3902#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3903#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3904#[cfg_attr(feature = "serde", serde(tag = "type"))]
3905#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3906#[repr(u32)]
3907pub enum MavlinkDataStreamType {
3908 MAVLINK_DATA_STREAM_IMG_JPEG = 0,
3909 MAVLINK_DATA_STREAM_IMG_BMP = 1,
3910 MAVLINK_DATA_STREAM_IMG_RAW8U = 2,
3911 MAVLINK_DATA_STREAM_IMG_RAW32U = 3,
3912 MAVLINK_DATA_STREAM_IMG_PGM = 4,
3913 MAVLINK_DATA_STREAM_IMG_PNG = 5,
3914}
3915impl MavlinkDataStreamType {
3916 pub const DEFAULT: Self = Self::MAVLINK_DATA_STREAM_IMG_JPEG;
3917}
3918impl Default for MavlinkDataStreamType {
3919 fn default() -> Self {
3920 Self::DEFAULT
3921 }
3922}
3923#[cfg_attr(feature = "ts", derive(TS))]
3924#[cfg_attr(feature = "ts", ts(export))]
3925#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3926#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3927#[cfg_attr(feature = "serde", serde(tag = "type"))]
3928#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3929#[repr(u32)]
3930#[doc = "States of the mission state machine. Note that these states are independent of whether the mission is in a mode that can execute mission items or not (is suspended). They may not all be relevant on all vehicles."]
3931pub enum MissionState {
3932 #[doc = "The mission status reporting is not supported."]
3933 MISSION_STATE_UNKNOWN = 0,
3934 #[doc = "No mission on the vehicle."]
3935 MISSION_STATE_NO_MISSION = 1,
3936 #[doc = "Mission has not started. This is the case after a mission has uploaded but not yet started executing."]
3937 MISSION_STATE_NOT_STARTED = 2,
3938 #[doc = "Mission is active, and will execute mission items when in auto mode."]
3939 MISSION_STATE_ACTIVE = 3,
3940 #[doc = "Mission is paused when in auto mode."]
3941 MISSION_STATE_PAUSED = 4,
3942 #[doc = "Mission has executed all mission items."]
3943 MISSION_STATE_COMPLETE = 5,
3944}
3945impl MissionState {
3946 pub const DEFAULT: Self = Self::MISSION_STATE_UNKNOWN;
3947}
3948impl Default for MissionState {
3949 fn default() -> Self {
3950 Self::DEFAULT
3951 }
3952}
3953#[cfg_attr(feature = "ts", derive(TS))]
3954#[cfg_attr(feature = "ts", ts(export))]
3955#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3956#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3957#[cfg_attr(feature = "serde", serde(tag = "type"))]
3958#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3959#[repr(u32)]
3960#[doc = "Sequence that motors are tested when using MAV_CMD_DO_MOTOR_TEST."]
3961pub enum MotorTestOrder {
3962 #[doc = "Default autopilot motor test method."]
3963 MOTOR_TEST_ORDER_DEFAULT = 0,
3964 #[doc = "Motor numbers are specified as their index in a predefined vehicle-specific sequence."]
3965 MOTOR_TEST_ORDER_SEQUENCE = 1,
3966 #[doc = "Motor numbers are specified as the output as labeled on the board."]
3967 MOTOR_TEST_ORDER_BOARD = 2,
3968}
3969impl MotorTestOrder {
3970 pub const DEFAULT: Self = Self::MOTOR_TEST_ORDER_DEFAULT;
3971}
3972impl Default for MotorTestOrder {
3973 fn default() -> Self {
3974 Self::DEFAULT
3975 }
3976}
3977#[cfg_attr(feature = "ts", derive(TS))]
3978#[cfg_attr(feature = "ts", ts(export))]
3979#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3980#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3981#[cfg_attr(feature = "serde", serde(tag = "type"))]
3982#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3983#[repr(u32)]
3984#[doc = "Defines how throttle value is represented in MAV_CMD_DO_MOTOR_TEST."]
3985pub enum MotorTestThrottleType {
3986 #[doc = "Throttle as a percentage (0 ~ 100)"]
3987 MOTOR_TEST_THROTTLE_PERCENT = 0,
3988 #[doc = "Throttle as an absolute PWM value (normally in range of 1000~2000)."]
3989 MOTOR_TEST_THROTTLE_PWM = 1,
3990 #[doc = "Throttle pass-through from pilot's transmitter."]
3991 MOTOR_TEST_THROTTLE_PILOT = 2,
3992 #[doc = "Per-motor compass calibration test."]
3993 MOTOR_TEST_COMPASS_CAL = 3,
3994}
3995impl MotorTestThrottleType {
3996 pub const DEFAULT: Self = Self::MOTOR_TEST_THROTTLE_PERCENT;
3997}
3998impl Default for MotorTestThrottleType {
3999 fn default() -> Self {
4000 Self::DEFAULT
4001 }
4002}
4003#[cfg_attr(feature = "ts", derive(TS))]
4004#[cfg_attr(feature = "ts", ts(export))]
4005#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4006#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4007#[cfg_attr(feature = "serde", serde(tag = "type"))]
4008#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4009#[repr(u32)]
4010pub enum NavVtolLandOptions {
4011 #[doc = "Default autopilot landing behaviour."]
4012 NAV_VTOL_LAND_OPTIONS_DEFAULT = 0,
4013 #[doc = "Descend in fixed wing mode, transitioning to multicopter mode for vertical landing when close to the ground. The fixed wing descent pattern is at the discretion of the vehicle (e.g. transition altitude, loiter direction, radius, and speed, etc.)."]
4014 NAV_VTOL_LAND_OPTIONS_FW_DESCENT = 1,
4015 #[doc = "Land in multicopter mode on reaching the landing coordinates (the whole landing is by \"hover descent\")."]
4016 NAV_VTOL_LAND_OPTIONS_HOVER_DESCENT = 2,
4017}
4018impl NavVtolLandOptions {
4019 pub const DEFAULT: Self = Self::NAV_VTOL_LAND_OPTIONS_DEFAULT;
4020}
4021impl Default for NavVtolLandOptions {
4022 fn default() -> Self {
4023 Self::DEFAULT
4024 }
4025}
4026#[cfg_attr(feature = "ts", derive(TS))]
4027#[cfg_attr(feature = "ts", ts(export))]
4028#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4029#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4030#[cfg_attr(feature = "serde", serde(tag = "type"))]
4031#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4032#[repr(u32)]
4033#[doc = "Yaw behaviour during orbit flight."]
4034pub enum OrbitYawBehaviour {
4035 #[doc = "Vehicle front points to the center (default)."]
4036 ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER = 0,
4037 #[doc = "Vehicle front holds heading when message received."]
4038 ORBIT_YAW_BEHAVIOUR_HOLD_INITIAL_HEADING = 1,
4039 #[doc = "Yaw uncontrolled."]
4040 ORBIT_YAW_BEHAVIOUR_UNCONTROLLED = 2,
4041 #[doc = "Vehicle front follows flight path (tangential to circle)."]
4042 ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TANGENT_TO_CIRCLE = 3,
4043 #[doc = "Yaw controlled by RC input."]
4044 ORBIT_YAW_BEHAVIOUR_RC_CONTROLLED = 4,
4045 #[doc = "Vehicle uses current yaw behaviour (unchanged). The vehicle-default yaw behaviour is used if this value is specified when orbit is first commanded."]
4046 ORBIT_YAW_BEHAVIOUR_UNCHANGED = 5,
4047}
4048impl OrbitYawBehaviour {
4049 pub const DEFAULT: Self = Self::ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER;
4050}
4051impl Default for OrbitYawBehaviour {
4052 fn default() -> Self {
4053 Self::DEFAULT
4054 }
4055}
4056#[cfg_attr(feature = "ts", derive(TS))]
4057#[cfg_attr(feature = "ts", ts(export))]
4058#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4059#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4060#[cfg_attr(feature = "serde", serde(tag = "type"))]
4061#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4062#[repr(u32)]
4063#[doc = "Parachute actions. Trigger release and enable/disable auto-release."]
4064pub enum ParachuteAction {
4065 #[doc = "Disable auto-release of parachute (i.e. release triggered by crash detectors)."]
4066 PARACHUTE_DISABLE = 0,
4067 #[doc = "Enable auto-release of parachute."]
4068 PARACHUTE_ENABLE = 1,
4069 #[doc = "Release parachute and kill motors."]
4070 PARACHUTE_RELEASE = 2,
4071}
4072impl ParachuteAction {
4073 pub const DEFAULT: Self = Self::PARACHUTE_DISABLE;
4074}
4075impl Default for ParachuteAction {
4076 fn default() -> Self {
4077 Self::DEFAULT
4078 }
4079}
4080#[cfg_attr(feature = "ts", derive(TS))]
4081#[cfg_attr(feature = "ts", ts(export))]
4082#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4083#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4084#[cfg_attr(feature = "serde", serde(tag = "type"))]
4085#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4086#[repr(u32)]
4087#[doc = "Result from PARAM_EXT_SET message."]
4088pub enum ParamAck {
4089 #[doc = "Parameter value ACCEPTED and SET"]
4090 PARAM_ACK_ACCEPTED = 0,
4091 #[doc = "Parameter value UNKNOWN/UNSUPPORTED"]
4092 PARAM_ACK_VALUE_UNSUPPORTED = 1,
4093 #[doc = "Parameter failed to set"]
4094 PARAM_ACK_FAILED = 2,
4095 #[doc = "Parameter value received but not yet set/accepted. A subsequent PARAM_EXT_ACK with the final result will follow once operation is completed. This is returned immediately for parameters that take longer to set, indicating that the the parameter was received and does not need to be resent."]
4096 PARAM_ACK_IN_PROGRESS = 3,
4097}
4098impl ParamAck {
4099 pub const DEFAULT: Self = Self::PARAM_ACK_ACCEPTED;
4100}
4101impl Default for ParamAck {
4102 fn default() -> Self {
4103 Self::DEFAULT
4104 }
4105}
4106bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 9 is set the floats afx afy afz should be interpreted as force instead of acceleration."] pub struct PositionTargetTypemask : u16 { # [doc = "Ignore position x"] const POSITION_TARGET_TYPEMASK_X_IGNORE = 1 ; # [doc = "Ignore position y"] const POSITION_TARGET_TYPEMASK_Y_IGNORE = 2 ; # [doc = "Ignore position z"] const POSITION_TARGET_TYPEMASK_Z_IGNORE = 4 ; # [doc = "Ignore velocity x"] const POSITION_TARGET_TYPEMASK_VX_IGNORE = 8 ; # [doc = "Ignore velocity y"] const POSITION_TARGET_TYPEMASK_VY_IGNORE = 16 ; # [doc = "Ignore velocity z"] const POSITION_TARGET_TYPEMASK_VZ_IGNORE = 32 ; # [doc = "Ignore acceleration x"] const POSITION_TARGET_TYPEMASK_AX_IGNORE = 64 ; # [doc = "Ignore acceleration y"] const POSITION_TARGET_TYPEMASK_AY_IGNORE = 128 ; # [doc = "Ignore acceleration z"] const POSITION_TARGET_TYPEMASK_AZ_IGNORE = 256 ; # [doc = "Use force instead of acceleration"] const POSITION_TARGET_TYPEMASK_FORCE_SET = 512 ; # [doc = "Ignore yaw"] const POSITION_TARGET_TYPEMASK_YAW_IGNORE = 1024 ; # [doc = "Ignore yaw rate"] const POSITION_TARGET_TYPEMASK_YAW_RATE_IGNORE = 2048 ; } }
4107impl PositionTargetTypemask {
4108 pub const DEFAULT: Self = Self::POSITION_TARGET_TYPEMASK_X_IGNORE;
4109}
4110impl Default for PositionTargetTypemask {
4111 fn default() -> Self {
4112 Self::DEFAULT
4113 }
4114}
4115#[cfg_attr(feature = "ts", derive(TS))]
4116#[cfg_attr(feature = "ts", ts(export))]
4117#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4118#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4119#[cfg_attr(feature = "serde", serde(tag = "type"))]
4120#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4121#[repr(u32)]
4122#[doc = "Precision land modes (used in MAV_CMD_NAV_LAND)."]
4123pub enum PrecisionLandMode {
4124 #[doc = "Normal (non-precision) landing."]
4125 PRECISION_LAND_MODE_DISABLED = 0,
4126 #[doc = "Use precision landing if beacon detected when land command accepted, otherwise land normally."]
4127 PRECISION_LAND_MODE_OPPORTUNISTIC = 1,
4128 #[doc = "Use precision landing, searching for beacon if not found when land command accepted (land normally if beacon cannot be found)."]
4129 PRECISION_LAND_MODE_REQUIRED = 2,
4130}
4131impl PrecisionLandMode {
4132 pub const DEFAULT: Self = Self::PRECISION_LAND_MODE_DISABLED;
4133}
4134impl Default for PrecisionLandMode {
4135 fn default() -> Self {
4136 Self::DEFAULT
4137 }
4138}
4139#[cfg_attr(feature = "ts", derive(TS))]
4140#[cfg_attr(feature = "ts", ts(export))]
4141#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4142#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4143#[cfg_attr(feature = "serde", serde(tag = "type"))]
4144#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4145#[repr(u32)]
4146#[doc = "Actions for reading and writing plan information (mission, rally points, geofence) between persistent and volatile storage when using MAV_CMD_PREFLIGHT_STORAGE. (Commonly missions are loaded from persistent storage (flash/EEPROM) into volatile storage (RAM) on startup and written back when they are changed.)"]
4147pub enum PreflightStorageMissionAction {
4148 #[doc = "Read current mission data from persistent storage"]
4149 MISSION_READ_PERSISTENT = 0,
4150 #[doc = "Write current mission data to persistent storage"]
4151 MISSION_WRITE_PERSISTENT = 1,
4152 #[doc = "Erase all mission data stored on the vehicle (both persistent and volatile storage)"]
4153 MISSION_RESET_DEFAULT = 2,
4154}
4155impl PreflightStorageMissionAction {
4156 pub const DEFAULT: Self = Self::MISSION_READ_PERSISTENT;
4157}
4158impl Default for PreflightStorageMissionAction {
4159 fn default() -> Self {
4160 Self::DEFAULT
4161 }
4162}
4163#[cfg_attr(feature = "ts", derive(TS))]
4164#[cfg_attr(feature = "ts", ts(export))]
4165#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4166#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4167#[cfg_attr(feature = "serde", serde(tag = "type"))]
4168#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4169#[repr(u32)]
4170#[doc = "Actions for reading/writing parameters between persistent and volatile storage when using MAV_CMD_PREFLIGHT_STORAGE. (Commonly parameters are loaded from persistent storage (flash/EEPROM) into volatile storage (RAM) on startup and written back when they are changed.)"]
4171pub enum PreflightStorageParameterAction {
4172 #[doc = "Read all parameters from persistent storage. Replaces values in volatile storage."]
4173 PARAM_READ_PERSISTENT = 0,
4174 #[doc = "Write all parameter values to persistent storage (flash/EEPROM)"]
4175 PARAM_WRITE_PERSISTENT = 1,
4176 #[doc = "Reset all user configurable parameters to their default value (including airframe selection, sensor calibration data, safety settings, and so on). Does not reset values that contain operation counters and vehicle computed statistics."]
4177 PARAM_RESET_CONFIG_DEFAULT = 2,
4178 #[doc = "Reset only sensor calibration parameters to factory defaults (or firmware default if not available)"]
4179 PARAM_RESET_SENSOR_DEFAULT = 3,
4180 #[doc = "Reset all parameters, including operation counters, to default values"]
4181 PARAM_RESET_ALL_DEFAULT = 4,
4182}
4183impl PreflightStorageParameterAction {
4184 pub const DEFAULT: Self = Self::PARAM_READ_PERSISTENT;
4185}
4186impl Default for PreflightStorageParameterAction {
4187 fn default() -> Self {
4188 Self::DEFAULT
4189 }
4190}
4191#[cfg_attr(feature = "ts", derive(TS))]
4192#[cfg_attr(feature = "ts", ts(export))]
4193#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4194#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4195#[cfg_attr(feature = "serde", serde(tag = "type"))]
4196#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4197#[repr(u32)]
4198#[doc = "RC sub-type of types defined in RC_TYPE. Used in MAV_CMD_START_RX_PAIR. Ignored if value does not correspond to the set RC_TYPE."]
4199pub enum RcSubType {
4200 #[doc = "Spektrum DSM2"]
4201 RC_SUB_TYPE_SPEKTRUM_DSM2 = 0,
4202 #[doc = "Spektrum DSMX"]
4203 RC_SUB_TYPE_SPEKTRUM_DSMX = 1,
4204 #[doc = "Spektrum DSMX8"]
4205 RC_SUB_TYPE_SPEKTRUM_DSMX8 = 2,
4206}
4207impl RcSubType {
4208 pub const DEFAULT: Self = Self::RC_SUB_TYPE_SPEKTRUM_DSM2;
4209}
4210impl Default for RcSubType {
4211 fn default() -> Self {
4212 Self::DEFAULT
4213 }
4214}
4215#[cfg_attr(feature = "ts", derive(TS))]
4216#[cfg_attr(feature = "ts", ts(export))]
4217#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4218#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4219#[cfg_attr(feature = "serde", serde(tag = "type"))]
4220#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4221#[repr(u32)]
4222#[doc = "RC type. Used in MAV_CMD_START_RX_PAIR."]
4223pub enum RcType {
4224 #[doc = "Spektrum"]
4225 RC_TYPE_SPEKTRUM = 0,
4226 #[doc = "CRSF"]
4227 RC_TYPE_CRSF = 1,
4228}
4229impl RcType {
4230 pub const DEFAULT: Self = Self::RC_TYPE_SPEKTRUM;
4231}
4232impl Default for RcType {
4233 fn default() -> Self {
4234 Self::DEFAULT
4235 }
4236}
4237#[cfg_attr(feature = "ts", derive(TS))]
4238#[cfg_attr(feature = "ts", ts(export))]
4239#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4240#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4241#[cfg_attr(feature = "serde", serde(tag = "type"))]
4242#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4243#[repr(u32)]
4244#[doc = "Specifies the conditions under which the MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN command should be accepted."]
4245pub enum RebootShutdownConditions {
4246 #[doc = "Reboot/Shutdown only if allowed by safety checks, such as being landed."]
4247 REBOOT_SHUTDOWN_CONDITIONS_SAFETY_INTERLOCKED = 0,
4248 #[doc = "Force reboot/shutdown of the autopilot/component regardless of system state."]
4249 REBOOT_SHUTDOWN_CONDITIONS_FORCE = 20190226,
4250}
4251impl RebootShutdownConditions {
4252 pub const DEFAULT: Self = Self::REBOOT_SHUTDOWN_CONDITIONS_SAFETY_INTERLOCKED;
4253}
4254impl Default for RebootShutdownConditions {
4255 fn default() -> Self {
4256 Self::DEFAULT
4257 }
4258}
4259#[cfg_attr(feature = "ts", derive(TS))]
4260#[cfg_attr(feature = "ts", ts(export))]
4261#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4262#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4263#[cfg_attr(feature = "serde", serde(tag = "type"))]
4264#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4265#[repr(u32)]
4266#[doc = "RTK GPS baseline coordinate system, used for RTK corrections"]
4267pub enum RtkBaselineCoordinateSystem {
4268 #[doc = "Earth-centered, Earth-fixed"]
4269 RTK_BASELINE_COORDINATE_SYSTEM_ECEF = 0,
4270 #[doc = "RTK basestation centered, north, east, down"]
4271 RTK_BASELINE_COORDINATE_SYSTEM_NED = 1,
4272}
4273impl RtkBaselineCoordinateSystem {
4274 pub const DEFAULT: Self = Self::RTK_BASELINE_COORDINATE_SYSTEM_ECEF;
4275}
4276impl Default for RtkBaselineCoordinateSystem {
4277 fn default() -> Self {
4278 Self::DEFAULT
4279 }
4280}
4281#[cfg_attr(feature = "ts", derive(TS))]
4282#[cfg_attr(feature = "ts", ts(export))]
4283#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4284#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4285#[cfg_attr(feature = "serde", serde(tag = "type"))]
4286#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4287#[repr(u32)]
4288#[doc = "Possible safety switch states."]
4289pub enum SafetySwitchState {
4290 #[doc = "Safety switch is engaged and vehicle should be safe to approach."]
4291 SAFETY_SWITCH_STATE_SAFE = 0,
4292 #[doc = "Safety switch is NOT engaged and motors, propellers and other actuators should be considered active."]
4293 SAFETY_SWITCH_STATE_DANGEROUS = 1,
4294}
4295impl SafetySwitchState {
4296 pub const DEFAULT: Self = Self::SAFETY_SWITCH_STATE_SAFE;
4297}
4298impl Default for SafetySwitchState {
4299 fn default() -> Self {
4300 Self::DEFAULT
4301 }
4302}
4303#[cfg_attr(feature = "ts", derive(TS))]
4304#[cfg_attr(feature = "ts", ts(export))]
4305#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4306#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4307#[cfg_attr(feature = "serde", serde(tag = "type"))]
4308#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4309#[repr(u32)]
4310#[doc = "SERIAL_CONTROL device types"]
4311pub enum SerialControlDev {
4312 #[doc = "First telemetry port"]
4313 SERIAL_CONTROL_DEV_TELEM1 = 0,
4314 #[doc = "Second telemetry port"]
4315 SERIAL_CONTROL_DEV_TELEM2 = 1,
4316 #[doc = "First GPS port"]
4317 SERIAL_CONTROL_DEV_GPS1 = 2,
4318 #[doc = "Second GPS port"]
4319 SERIAL_CONTROL_DEV_GPS2 = 3,
4320 #[doc = "system shell"]
4321 SERIAL_CONTROL_DEV_SHELL = 10,
4322 #[doc = "SERIAL0"]
4323 SERIAL_CONTROL_SERIAL0 = 100,
4324 #[doc = "SERIAL1"]
4325 SERIAL_CONTROL_SERIAL1 = 101,
4326 #[doc = "SERIAL2"]
4327 SERIAL_CONTROL_SERIAL2 = 102,
4328 #[doc = "SERIAL3"]
4329 SERIAL_CONTROL_SERIAL3 = 103,
4330 #[doc = "SERIAL4"]
4331 SERIAL_CONTROL_SERIAL4 = 104,
4332 #[doc = "SERIAL5"]
4333 SERIAL_CONTROL_SERIAL5 = 105,
4334 #[doc = "SERIAL6"]
4335 SERIAL_CONTROL_SERIAL6 = 106,
4336 #[doc = "SERIAL7"]
4337 SERIAL_CONTROL_SERIAL7 = 107,
4338 #[doc = "SERIAL8"]
4339 SERIAL_CONTROL_SERIAL8 = 108,
4340 #[doc = "SERIAL9"]
4341 SERIAL_CONTROL_SERIAL9 = 109,
4342}
4343impl SerialControlDev {
4344 pub const DEFAULT: Self = Self::SERIAL_CONTROL_DEV_TELEM1;
4345}
4346impl Default for SerialControlDev {
4347 fn default() -> Self {
4348 Self::DEFAULT
4349 }
4350}
4351bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "SERIAL_CONTROL flags (bitmask)"] pub struct SerialControlFlag : u8 { # [doc = "Set if this is a reply"] const SERIAL_CONTROL_FLAG_REPLY = 1 ; # [doc = "Set if the sender wants the receiver to send a response as another SERIAL_CONTROL message"] const SERIAL_CONTROL_FLAG_RESPOND = 2 ; # [doc = "Set if access to the serial port should be removed from whatever driver is currently using it, giving exclusive access to the SERIAL_CONTROL protocol. The port can be handed back by sending a request without this flag set"] const SERIAL_CONTROL_FLAG_EXCLUSIVE = 4 ; # [doc = "Block on writes to the serial port"] const SERIAL_CONTROL_FLAG_BLOCKING = 8 ; # [doc = "Send multiple replies until port is drained"] const SERIAL_CONTROL_FLAG_MULTI = 16 ; } }
4352impl SerialControlFlag {
4353 pub const DEFAULT: Self = Self::SERIAL_CONTROL_FLAG_REPLY;
4354}
4355impl Default for SerialControlFlag {
4356 fn default() -> Self {
4357 Self::DEFAULT
4358 }
4359}
4360#[cfg_attr(feature = "ts", derive(TS))]
4361#[cfg_attr(feature = "ts", ts(export))]
4362#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4363#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4364#[cfg_attr(feature = "serde", serde(tag = "type"))]
4365#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4366#[repr(u32)]
4367#[doc = "Focus types for MAV_CMD_SET_CAMERA_FOCUS"]
4368pub enum SetFocusType {
4369 #[doc = "Focus one step increment (-1 for focusing in, 1 for focusing out towards infinity)."]
4370 FOCUS_TYPE_STEP = 0,
4371 #[doc = "Continuous normalized focus in/out rate until stopped. Range -1..1, negative: in, positive: out towards infinity, 0 to stop focusing. Other values should be clipped to the range."]
4372 FOCUS_TYPE_CONTINUOUS = 1,
4373 #[doc = "Focus value as proportion of full camera focus range (a value between 0.0 and 100.0)"]
4374 FOCUS_TYPE_RANGE = 2,
4375 #[doc = "Focus value in metres. Note that there is no message to get the valid focus range of the camera, so this can type can only be used for cameras where the range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera)."]
4376 FOCUS_TYPE_METERS = 3,
4377 #[doc = "Focus automatically."]
4378 FOCUS_TYPE_AUTO = 4,
4379 #[doc = "Single auto focus. Mainly used for still pictures. Usually abbreviated as AF-S."]
4380 FOCUS_TYPE_AUTO_SINGLE = 5,
4381 #[doc = "Continuous auto focus. Mainly used for dynamic scenes. Abbreviated as AF-C."]
4382 FOCUS_TYPE_AUTO_CONTINUOUS = 6,
4383}
4384impl SetFocusType {
4385 pub const DEFAULT: Self = Self::FOCUS_TYPE_STEP;
4386}
4387impl Default for SetFocusType {
4388 fn default() -> Self {
4389 Self::DEFAULT
4390 }
4391}
4392#[cfg_attr(feature = "ts", derive(TS))]
4393#[cfg_attr(feature = "ts", ts(export))]
4394#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4395#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4396#[cfg_attr(feature = "serde", serde(tag = "type"))]
4397#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4398#[repr(u32)]
4399#[doc = "Speed setpoint types used in MAV_CMD_DO_CHANGE_SPEED"]
4400pub enum SpeedType {
4401 #[doc = "Airspeed"]
4402 SPEED_TYPE_AIRSPEED = 0,
4403 #[doc = "Groundspeed"]
4404 SPEED_TYPE_GROUNDSPEED = 1,
4405 #[doc = "Climb speed"]
4406 SPEED_TYPE_CLIMB_SPEED = 2,
4407 #[doc = "Descent speed"]
4408 SPEED_TYPE_DESCENT_SPEED = 3,
4409}
4410impl SpeedType {
4411 pub const DEFAULT: Self = Self::SPEED_TYPE_AIRSPEED;
4412}
4413impl Default for SpeedType {
4414 fn default() -> Self {
4415 Self::DEFAULT
4416 }
4417}
4418#[cfg_attr(feature = "ts", derive(TS))]
4419#[cfg_attr(feature = "ts", ts(export))]
4420#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4421#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4422#[cfg_attr(feature = "serde", serde(tag = "type"))]
4423#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4424#[repr(u32)]
4425#[doc = "Flags to indicate the status of camera storage."]
4426pub enum StorageStatus {
4427 #[doc = "Storage is missing (no microSD card loaded for example.)"]
4428 STORAGE_STATUS_EMPTY = 0,
4429 #[doc = "Storage present but unformatted."]
4430 STORAGE_STATUS_UNFORMATTED = 1,
4431 #[doc = "Storage present and ready."]
4432 STORAGE_STATUS_READY = 2,
4433 #[doc = "Camera does not supply storage status information. Capacity information in STORAGE_INFORMATION fields will be ignored."]
4434 STORAGE_STATUS_NOT_SUPPORTED = 3,
4435}
4436impl StorageStatus {
4437 pub const DEFAULT: Self = Self::STORAGE_STATUS_EMPTY;
4438}
4439impl Default for StorageStatus {
4440 fn default() -> Self {
4441 Self::DEFAULT
4442 }
4443}
4444#[cfg_attr(feature = "ts", derive(TS))]
4445#[cfg_attr(feature = "ts", ts(export))]
4446#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4447#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4448#[cfg_attr(feature = "serde", serde(tag = "type"))]
4449#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4450#[repr(u32)]
4451#[doc = "Flags to indicate the type of storage."]
4452pub enum StorageType {
4453 #[doc = "Storage type is not known."]
4454 STORAGE_TYPE_UNKNOWN = 0,
4455 #[doc = "Storage type is USB device."]
4456 STORAGE_TYPE_USB_STICK = 1,
4457 #[doc = "Storage type is SD card."]
4458 STORAGE_TYPE_SD = 2,
4459 #[doc = "Storage type is microSD card."]
4460 STORAGE_TYPE_MICROSD = 3,
4461 #[doc = "Storage type is CFast."]
4462 STORAGE_TYPE_CF = 4,
4463 #[doc = "Storage type is CFexpress."]
4464 STORAGE_TYPE_CFE = 5,
4465 #[doc = "Storage type is XQD."]
4466 STORAGE_TYPE_XQD = 6,
4467 #[doc = "Storage type is HD mass storage type."]
4468 STORAGE_TYPE_HD = 7,
4469 #[doc = "Storage type is other, not listed type."]
4470 STORAGE_TYPE_OTHER = 254,
4471}
4472impl StorageType {
4473 pub const DEFAULT: Self = Self::STORAGE_TYPE_UNKNOWN;
4474}
4475impl Default for StorageType {
4476 fn default() -> Self {
4477 Self::DEFAULT
4478 }
4479}
4480bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to indicate usage for a particular storage (see STORAGE_INFORMATION.storage_usage and MAV_CMD_SET_STORAGE_USAGE)."] pub struct StorageUsageFlag : u8 { # [doc = "Always set to 1 (indicates STORAGE_INFORMATION.storage_usage is supported)."] const STORAGE_USAGE_FLAG_SET = 1 ; # [doc = "Storage for saving photos."] const STORAGE_USAGE_FLAG_PHOTO = 2 ; # [doc = "Storage for saving videos."] const STORAGE_USAGE_FLAG_VIDEO = 4 ; # [doc = "Storage for saving logs."] const STORAGE_USAGE_FLAG_LOGS = 8 ; } }
4481impl StorageUsageFlag {
4482 pub const DEFAULT: Self = Self::STORAGE_USAGE_FLAG_SET;
4483}
4484impl Default for StorageUsageFlag {
4485 fn default() -> Self {
4486 Self::DEFAULT
4487 }
4488}
4489#[cfg_attr(feature = "ts", derive(TS))]
4490#[cfg_attr(feature = "ts", ts(export))]
4491#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4492#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4493#[cfg_attr(feature = "serde", serde(tag = "type"))]
4494#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4495#[repr(u32)]
4496#[doc = "Tune formats (used for vehicle buzzer/tone generation)."]
4497pub enum TuneFormat {
4498 #[doc = "Format is QBasic 1.1 Play: <https://www.qbasic.net/en/reference/qb11/Statement/PLAY-006.htm>."]
4499 TUNE_FORMAT_QBASIC1_1 = 1,
4500 #[doc = "Format is Modern Music Markup Language (MML): <https://en.wikipedia.org/wiki/Music_Macro_Language#Modern_MML>."]
4501 TUNE_FORMAT_MML_MODERN = 2,
4502}
4503impl TuneFormat {
4504 pub const DEFAULT: Self = Self::TUNE_FORMAT_QBASIC1_1;
4505}
4506impl Default for TuneFormat {
4507 fn default() -> Self {
4508 Self::DEFAULT
4509 }
4510}
4511#[cfg_attr(feature = "ts", derive(TS))]
4512#[cfg_attr(feature = "ts", ts(export))]
4513#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4514#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4515#[cfg_attr(feature = "serde", serde(tag = "type"))]
4516#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4517#[repr(u32)]
4518#[doc = "Generalized UAVCAN node health"]
4519pub enum UavcanNodeHealth {
4520 #[doc = "The node is functioning properly."]
4521 UAVCAN_NODE_HEALTH_OK = 0,
4522 #[doc = "A critical parameter went out of range or the node has encountered a minor failure."]
4523 UAVCAN_NODE_HEALTH_WARNING = 1,
4524 #[doc = "The node has encountered a major failure."]
4525 UAVCAN_NODE_HEALTH_ERROR = 2,
4526 #[doc = "The node has suffered a fatal malfunction."]
4527 UAVCAN_NODE_HEALTH_CRITICAL = 3,
4528}
4529impl UavcanNodeHealth {
4530 pub const DEFAULT: Self = Self::UAVCAN_NODE_HEALTH_OK;
4531}
4532impl Default for UavcanNodeHealth {
4533 fn default() -> Self {
4534 Self::DEFAULT
4535 }
4536}
4537#[cfg_attr(feature = "ts", derive(TS))]
4538#[cfg_attr(feature = "ts", ts(export))]
4539#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4540#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4541#[cfg_attr(feature = "serde", serde(tag = "type"))]
4542#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4543#[repr(u32)]
4544#[doc = "Generalized UAVCAN node mode"]
4545pub enum UavcanNodeMode {
4546 #[doc = "The node is performing its primary functions."]
4547 UAVCAN_NODE_MODE_OPERATIONAL = 0,
4548 #[doc = "The node is initializing; this mode is entered immediately after startup."]
4549 UAVCAN_NODE_MODE_INITIALIZATION = 1,
4550 #[doc = "The node is under maintenance."]
4551 UAVCAN_NODE_MODE_MAINTENANCE = 2,
4552 #[doc = "The node is in the process of updating its software."]
4553 UAVCAN_NODE_MODE_SOFTWARE_UPDATE = 3,
4554 #[doc = "The node is no longer available online."]
4555 UAVCAN_NODE_MODE_OFFLINE = 7,
4556}
4557impl UavcanNodeMode {
4558 pub const DEFAULT: Self = Self::UAVCAN_NODE_MODE_OPERATIONAL;
4559}
4560impl Default for UavcanNodeMode {
4561 fn default() -> Self {
4562 Self::DEFAULT
4563 }
4564}
4565bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for the global position report."] pub struct UtmDataAvailFlags : u8 { # [doc = "The field time contains valid data."] const UTM_DATA_AVAIL_FLAGS_TIME_VALID = 1 ; # [doc = "The field uas_id contains valid data."] const UTM_DATA_AVAIL_FLAGS_UAS_ID_AVAILABLE = 2 ; # [doc = "The fields lat, lon and h_acc contain valid data."] const UTM_DATA_AVAIL_FLAGS_POSITION_AVAILABLE = 4 ; # [doc = "The fields alt and v_acc contain valid data."] const UTM_DATA_AVAIL_FLAGS_ALTITUDE_AVAILABLE = 8 ; # [doc = "The field relative_alt contains valid data."] const UTM_DATA_AVAIL_FLAGS_RELATIVE_ALTITUDE_AVAILABLE = 16 ; # [doc = "The fields vx and vy contain valid data."] const UTM_DATA_AVAIL_FLAGS_HORIZONTAL_VELO_AVAILABLE = 32 ; # [doc = "The field vz contains valid data."] const UTM_DATA_AVAIL_FLAGS_VERTICAL_VELO_AVAILABLE = 64 ; # [doc = "The fields next_lat, next_lon and next_alt contain valid data."] const UTM_DATA_AVAIL_FLAGS_NEXT_WAYPOINT_AVAILABLE = 128 ; } }
4566impl UtmDataAvailFlags {
4567 pub const DEFAULT: Self = Self::UTM_DATA_AVAIL_FLAGS_TIME_VALID;
4568}
4569impl Default for UtmDataAvailFlags {
4570 fn default() -> Self {
4571 Self::DEFAULT
4572 }
4573}
4574#[cfg_attr(feature = "ts", derive(TS))]
4575#[cfg_attr(feature = "ts", ts(export))]
4576#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4577#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4578#[cfg_attr(feature = "serde", serde(tag = "type"))]
4579#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4580#[repr(u32)]
4581#[doc = "Airborne status of UAS."]
4582pub enum UtmFlightState {
4583 #[doc = "The flight state can't be determined."]
4584 UTM_FLIGHT_STATE_UNKNOWN = 1,
4585 #[doc = "UAS on ground."]
4586 UTM_FLIGHT_STATE_GROUND = 2,
4587 #[doc = "UAS airborne."]
4588 UTM_FLIGHT_STATE_AIRBORNE = 3,
4589 #[doc = "UAS is in an emergency flight state."]
4590 UTM_FLIGHT_STATE_EMERGENCY = 16,
4591 #[doc = "UAS has no active controls."]
4592 UTM_FLIGHT_STATE_NOCTRL = 32,
4593}
4594impl UtmFlightState {
4595 pub const DEFAULT: Self = Self::UTM_FLIGHT_STATE_UNKNOWN;
4596}
4597impl Default for UtmFlightState {
4598 fn default() -> Self {
4599 Self::DEFAULT
4600 }
4601}
4602#[cfg_attr(feature = "ts", derive(TS))]
4603#[cfg_attr(feature = "ts", ts(export))]
4604#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4605#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4606#[cfg_attr(feature = "serde", serde(tag = "type"))]
4607#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4608#[repr(u32)]
4609#[doc = "Video stream encodings"]
4610pub enum VideoStreamEncoding {
4611 #[doc = "Stream encoding is unknown"]
4612 VIDEO_STREAM_ENCODING_UNKNOWN = 0,
4613 #[doc = "Stream encoding is H.264"]
4614 VIDEO_STREAM_ENCODING_H264 = 1,
4615 #[doc = "Stream encoding is H.265"]
4616 VIDEO_STREAM_ENCODING_H265 = 2,
4617}
4618impl VideoStreamEncoding {
4619 pub const DEFAULT: Self = Self::VIDEO_STREAM_ENCODING_UNKNOWN;
4620}
4621impl Default for VideoStreamEncoding {
4622 fn default() -> Self {
4623 Self::DEFAULT
4624 }
4625}
4626bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Stream status flags (Bitmap)"] pub struct VideoStreamStatusFlags : u16 { # [doc = "Stream is active (running)"] const VIDEO_STREAM_STATUS_FLAGS_RUNNING = 1 ; # [doc = "Stream is thermal imaging"] const VIDEO_STREAM_STATUS_FLAGS_THERMAL = 2 ; # [doc = "Stream can report absolute thermal range (see CAMERA_THERMAL_RANGE)."] const VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED = 4 ; } }
4627impl VideoStreamStatusFlags {
4628 pub const DEFAULT: Self = Self::VIDEO_STREAM_STATUS_FLAGS_RUNNING;
4629}
4630impl Default for VideoStreamStatusFlags {
4631 fn default() -> Self {
4632 Self::DEFAULT
4633 }
4634}
4635#[cfg_attr(feature = "ts", derive(TS))]
4636#[cfg_attr(feature = "ts", ts(export))]
4637#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4638#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4639#[cfg_attr(feature = "serde", serde(tag = "type"))]
4640#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4641#[repr(u32)]
4642#[doc = "Video stream types"]
4643pub enum VideoStreamType {
4644 #[doc = "Stream is RTSP"]
4645 VIDEO_STREAM_TYPE_RTSP = 0,
4646 #[doc = "Stream is RTP UDP (URI gives the port number)"]
4647 VIDEO_STREAM_TYPE_RTPUDP = 1,
4648 #[doc = "Stream is MPEG on TCP"]
4649 VIDEO_STREAM_TYPE_TCP_MPEG = 2,
4650 #[doc = "Stream is MPEG TS (URI gives the port number)"]
4651 VIDEO_STREAM_TYPE_MPEG_TS = 3,
4652}
4653impl VideoStreamType {
4654 pub const DEFAULT: Self = Self::VIDEO_STREAM_TYPE_RTSP;
4655}
4656impl Default for VideoStreamType {
4657 fn default() -> Self {
4658 Self::DEFAULT
4659 }
4660}
4661#[cfg_attr(feature = "ts", derive(TS))]
4662#[cfg_attr(feature = "ts", ts(export))]
4663#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4664#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4665#[cfg_attr(feature = "serde", serde(tag = "type"))]
4666#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4667#[repr(u32)]
4668#[doc = "Direction of VTOL transition"]
4669pub enum VtolTransitionHeading {
4670 #[doc = "Respect the heading configuration of the vehicle."]
4671 VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT = 0,
4672 #[doc = "Use the heading pointing towards the next waypoint."]
4673 VTOL_TRANSITION_HEADING_NEXT_WAYPOINT = 1,
4674 #[doc = "Use the heading on takeoff (while sitting on the ground)."]
4675 VTOL_TRANSITION_HEADING_TAKEOFF = 2,
4676 #[doc = "Use the specified heading in parameter 4."]
4677 VTOL_TRANSITION_HEADING_SPECIFIED = 3,
4678 #[doc = "Use the current heading when reaching takeoff altitude (potentially facing the wind when weather-vaning is active)."]
4679 VTOL_TRANSITION_HEADING_ANY = 4,
4680}
4681impl VtolTransitionHeading {
4682 pub const DEFAULT: Self = Self::VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT;
4683}
4684impl Default for VtolTransitionHeading {
4685 fn default() -> Self {
4686 Self::DEFAULT
4687 }
4688}
4689#[cfg_attr(feature = "ts", derive(TS))]
4690#[cfg_attr(feature = "ts", ts(export))]
4691#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4692#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4693#[cfg_attr(feature = "serde", serde(tag = "type"))]
4694#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4695#[repr(u32)]
4696#[doc = "WiFi Mode."]
4697pub enum WifiConfigApMode {
4698 #[doc = "WiFi mode is undefined."]
4699 WIFI_CONFIG_AP_MODE_UNDEFINED = 0,
4700 #[doc = "WiFi configured as an access point."]
4701 WIFI_CONFIG_AP_MODE_AP = 1,
4702 #[doc = "WiFi configured as a station connected to an existing local WiFi network."]
4703 WIFI_CONFIG_AP_MODE_STATION = 2,
4704 #[doc = "WiFi disabled."]
4705 WIFI_CONFIG_AP_MODE_DISABLED = 3,
4706}
4707impl WifiConfigApMode {
4708 pub const DEFAULT: Self = Self::WIFI_CONFIG_AP_MODE_UNDEFINED;
4709}
4710impl Default for WifiConfigApMode {
4711 fn default() -> Self {
4712 Self::DEFAULT
4713 }
4714}
4715#[cfg_attr(feature = "ts", derive(TS))]
4716#[cfg_attr(feature = "ts", ts(export))]
4717#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4718#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4719#[cfg_attr(feature = "serde", serde(tag = "type"))]
4720#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4721#[repr(u32)]
4722#[doc = "Possible responses from a WIFI_CONFIG_AP message."]
4723pub enum WifiConfigApResponse {
4724 #[doc = "Undefined response. Likely an indicative of a system that doesn't support this request."]
4725 WIFI_CONFIG_AP_RESPONSE_UNDEFINED = 0,
4726 #[doc = "Changes accepted."]
4727 WIFI_CONFIG_AP_RESPONSE_ACCEPTED = 1,
4728 #[doc = "Changes rejected."]
4729 WIFI_CONFIG_AP_RESPONSE_REJECTED = 2,
4730 #[doc = "Invalid Mode."]
4731 WIFI_CONFIG_AP_RESPONSE_MODE_ERROR = 3,
4732 #[doc = "Invalid SSID."]
4733 WIFI_CONFIG_AP_RESPONSE_SSID_ERROR = 4,
4734 #[doc = "Invalid Password."]
4735 WIFI_CONFIG_AP_RESPONSE_PASSWORD_ERROR = 5,
4736}
4737impl WifiConfigApResponse {
4738 pub const DEFAULT: Self = Self::WIFI_CONFIG_AP_RESPONSE_UNDEFINED;
4739}
4740impl Default for WifiConfigApResponse {
4741 fn default() -> Self {
4742 Self::DEFAULT
4743 }
4744}
4745#[cfg_attr(feature = "ts", derive(TS))]
4746#[cfg_attr(feature = "ts", ts(export))]
4747#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4748#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4749#[cfg_attr(feature = "serde", serde(tag = "type"))]
4750#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4751#[repr(u32)]
4752#[doc = "Winch actions."]
4753pub enum WinchActions {
4754 #[doc = "Allow motor to freewheel."]
4755 WINCH_RELAXED = 0,
4756 #[doc = "Wind or unwind specified length of line, optionally using specified rate."]
4757 WINCH_RELATIVE_LENGTH_CONTROL = 1,
4758 #[doc = "Wind or unwind line at specified rate."]
4759 WINCH_RATE_CONTROL = 2,
4760 #[doc = "Perform the locking sequence to relieve motor while in the fully retracted position. Only action and instance command parameters are used, others are ignored."]
4761 WINCH_LOCK = 3,
4762 #[doc = "Sequence of drop, slow down, touch down, reel up, lock. Only action and instance command parameters are used, others are ignored."]
4763 WINCH_DELIVER = 4,
4764 #[doc = "Engage motor and hold current position. Only action and instance command parameters are used, others are ignored."]
4765 WINCH_HOLD = 5,
4766 #[doc = "Return the reel to the fully retracted position. Only action and instance command parameters are used, others are ignored."]
4767 WINCH_RETRACT = 6,
4768 #[doc = "Load the reel with line. The winch will calculate the total loaded length and stop when the tension exceeds a threshold. Only action and instance command parameters are used, others are ignored."]
4769 WINCH_LOAD_LINE = 7,
4770 #[doc = "Spool out the entire length of the line. Only action and instance command parameters are used, others are ignored."]
4771 WINCH_ABANDON_LINE = 8,
4772 #[doc = "Spools out just enough to present the hook to the user to load the payload. Only action and instance command parameters are used, others are ignored"]
4773 WINCH_LOAD_PAYLOAD = 9,
4774}
4775impl WinchActions {
4776 pub const DEFAULT: Self = Self::WINCH_RELAXED;
4777}
4778impl Default for WinchActions {
4779 fn default() -> Self {
4780 Self::DEFAULT
4781 }
4782}
4783#[doc = "Set the vehicle attitude and body angular rates."]
4784#[doc = ""]
4785#[doc = "ID: 140"]
4786#[derive(Debug, Clone, PartialEq)]
4787#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4788#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4789#[cfg_attr(feature = "ts", derive(TS))]
4790#[cfg_attr(feature = "ts", ts(export))]
4791pub struct ACTUATOR_CONTROL_TARGET_DATA {
4792 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
4793 pub time_usec: u64,
4794 #[doc = "Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs."]
4795 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4796 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
4797 pub controls: [f32; 8],
4798 #[doc = "Actuator group. The \"_mlx\" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances."]
4799 pub group_mlx: u8,
4800}
4801impl ACTUATOR_CONTROL_TARGET_DATA {
4802 pub const ENCODED_LEN: usize = 41usize;
4803 pub const DEFAULT: Self = Self {
4804 time_usec: 0_u64,
4805 controls: [0.0_f32; 8usize],
4806 group_mlx: 0_u8,
4807 };
4808 #[cfg(feature = "arbitrary")]
4809 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4810 use arbitrary::{Arbitrary, Unstructured};
4811 let mut buf = [0u8; 1024];
4812 rng.fill_bytes(&mut buf);
4813 let mut unstructured = Unstructured::new(&buf);
4814 Self::arbitrary(&mut unstructured).unwrap_or_default()
4815 }
4816}
4817impl Default for ACTUATOR_CONTROL_TARGET_DATA {
4818 fn default() -> Self {
4819 Self::DEFAULT.clone()
4820 }
4821}
4822impl MessageData for ACTUATOR_CONTROL_TARGET_DATA {
4823 type Message = MavMessage;
4824 const ID: u32 = 140u32;
4825 const NAME: &'static str = "ACTUATOR_CONTROL_TARGET";
4826 const EXTRA_CRC: u8 = 181u8;
4827 const ENCODED_LEN: usize = 41usize;
4828 fn deser(
4829 _version: MavlinkVersion,
4830 __input: &[u8],
4831 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4832 let avail_len = __input.len();
4833 let mut payload_buf = [0; Self::ENCODED_LEN];
4834 let mut buf = if avail_len < Self::ENCODED_LEN {
4835 payload_buf[0..avail_len].copy_from_slice(__input);
4836 Bytes::new(&payload_buf)
4837 } else {
4838 Bytes::new(__input)
4839 };
4840 let mut __struct = Self::default();
4841 __struct.time_usec = buf.get_u64_le();
4842 for v in &mut __struct.controls {
4843 let val = buf.get_f32_le();
4844 *v = val;
4845 }
4846 __struct.group_mlx = buf.get_u8();
4847 Ok(__struct)
4848 }
4849 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4850 let mut __tmp = BytesMut::new(bytes);
4851 #[allow(clippy::absurd_extreme_comparisons)]
4852 #[allow(unused_comparisons)]
4853 if __tmp.remaining() < Self::ENCODED_LEN {
4854 panic!(
4855 "buffer is too small (need {} bytes, but got {})",
4856 Self::ENCODED_LEN,
4857 __tmp.remaining(),
4858 )
4859 }
4860 __tmp.put_u64_le(self.time_usec);
4861 for val in &self.controls {
4862 __tmp.put_f32_le(*val);
4863 }
4864 __tmp.put_u8(self.group_mlx);
4865 if matches!(version, MavlinkVersion::V2) {
4866 let len = __tmp.len();
4867 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4868 } else {
4869 __tmp.len()
4870 }
4871 }
4872}
4873#[doc = "The raw values of the actuator outputs (e.g. on Pixhawk, from MAIN, AUX ports). This message supersedes SERVO_OUTPUT_RAW."]
4874#[doc = ""]
4875#[doc = "ID: 375"]
4876#[derive(Debug, Clone, PartialEq)]
4877#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4878#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4879#[cfg_attr(feature = "ts", derive(TS))]
4880#[cfg_attr(feature = "ts", ts(export))]
4881pub struct ACTUATOR_OUTPUT_STATUS_DATA {
4882 #[doc = "Timestamp (since system boot)."]
4883 pub time_usec: u64,
4884 #[doc = "Active outputs"]
4885 pub active: u32,
4886 #[doc = "Servo / motor output array values. Zero values indicate unused channels."]
4887 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4888 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
4889 pub actuator: [f32; 32],
4890}
4891impl ACTUATOR_OUTPUT_STATUS_DATA {
4892 pub const ENCODED_LEN: usize = 140usize;
4893 pub const DEFAULT: Self = Self {
4894 time_usec: 0_u64,
4895 active: 0_u32,
4896 actuator: [0.0_f32; 32usize],
4897 };
4898 #[cfg(feature = "arbitrary")]
4899 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4900 use arbitrary::{Arbitrary, Unstructured};
4901 let mut buf = [0u8; 1024];
4902 rng.fill_bytes(&mut buf);
4903 let mut unstructured = Unstructured::new(&buf);
4904 Self::arbitrary(&mut unstructured).unwrap_or_default()
4905 }
4906}
4907impl Default for ACTUATOR_OUTPUT_STATUS_DATA {
4908 fn default() -> Self {
4909 Self::DEFAULT.clone()
4910 }
4911}
4912impl MessageData for ACTUATOR_OUTPUT_STATUS_DATA {
4913 type Message = MavMessage;
4914 const ID: u32 = 375u32;
4915 const NAME: &'static str = "ACTUATOR_OUTPUT_STATUS";
4916 const EXTRA_CRC: u8 = 251u8;
4917 const ENCODED_LEN: usize = 140usize;
4918 fn deser(
4919 _version: MavlinkVersion,
4920 __input: &[u8],
4921 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4922 let avail_len = __input.len();
4923 let mut payload_buf = [0; Self::ENCODED_LEN];
4924 let mut buf = if avail_len < Self::ENCODED_LEN {
4925 payload_buf[0..avail_len].copy_from_slice(__input);
4926 Bytes::new(&payload_buf)
4927 } else {
4928 Bytes::new(__input)
4929 };
4930 let mut __struct = Self::default();
4931 __struct.time_usec = buf.get_u64_le();
4932 __struct.active = buf.get_u32_le();
4933 for v in &mut __struct.actuator {
4934 let val = buf.get_f32_le();
4935 *v = val;
4936 }
4937 Ok(__struct)
4938 }
4939 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4940 let mut __tmp = BytesMut::new(bytes);
4941 #[allow(clippy::absurd_extreme_comparisons)]
4942 #[allow(unused_comparisons)]
4943 if __tmp.remaining() < Self::ENCODED_LEN {
4944 panic!(
4945 "buffer is too small (need {} bytes, but got {})",
4946 Self::ENCODED_LEN,
4947 __tmp.remaining(),
4948 )
4949 }
4950 __tmp.put_u64_le(self.time_usec);
4951 __tmp.put_u32_le(self.active);
4952 for val in &self.actuator {
4953 __tmp.put_f32_le(*val);
4954 }
4955 if matches!(version, MavlinkVersion::V2) {
4956 let len = __tmp.len();
4957 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4958 } else {
4959 __tmp.len()
4960 }
4961 }
4962}
4963#[doc = "The location and information of an ADSB vehicle."]
4964#[doc = ""]
4965#[doc = "ID: 246"]
4966#[derive(Debug, Clone, PartialEq)]
4967#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4968#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4969#[cfg_attr(feature = "ts", derive(TS))]
4970#[cfg_attr(feature = "ts", ts(export))]
4971pub struct ADSB_VEHICLE_DATA {
4972 #[doc = "ICAO address"]
4973 pub ICAO_address: u32,
4974 #[doc = "Latitude"]
4975 pub lat: i32,
4976 #[doc = "Longitude"]
4977 pub lon: i32,
4978 #[doc = "Altitude(ASL)"]
4979 pub altitude: i32,
4980 #[doc = "Course over ground"]
4981 pub heading: u16,
4982 #[doc = "The horizontal velocity"]
4983 pub hor_velocity: u16,
4984 #[doc = "The vertical velocity. Positive is up"]
4985 pub ver_velocity: i16,
4986 #[doc = "Bitmap to indicate various statuses including valid data fields"]
4987 pub flags: AdsbFlags,
4988 #[doc = "Squawk code. Note that the code is in decimal: e.g. 7700 (general emergency) is encoded as binary 0b0001_1110_0001_0100, not(!) as 0b0000_111_111_000_000"]
4989 pub squawk: u16,
4990 #[doc = "ADSB altitude type."]
4991 pub altitude_type: AdsbAltitudeType,
4992 #[doc = "The callsign, 8+null"]
4993 #[cfg_attr(
4994 feature = "serde",
4995 serde(
4996 serialize_with = "crate::nulstr::serialize::<_, 9>",
4997 deserialize_with = "crate::nulstr::deserialize::<_, 9>"
4998 )
4999 )]
5000 #[cfg_attr(feature = "ts", ts(type = "string"))]
5001 pub callsign: [u8; 9],
5002 #[doc = "ADSB emitter type."]
5003 pub emitter_type: AdsbEmitterType,
5004 #[doc = "Time since last communication in seconds"]
5005 pub tslc: u8,
5006}
5007impl ADSB_VEHICLE_DATA {
5008 pub const ENCODED_LEN: usize = 38usize;
5009 pub const DEFAULT: Self = Self {
5010 ICAO_address: 0_u32,
5011 lat: 0_i32,
5012 lon: 0_i32,
5013 altitude: 0_i32,
5014 heading: 0_u16,
5015 hor_velocity: 0_u16,
5016 ver_velocity: 0_i16,
5017 flags: AdsbFlags::DEFAULT,
5018 squawk: 0_u16,
5019 altitude_type: AdsbAltitudeType::DEFAULT,
5020 callsign: [0_u8; 9usize],
5021 emitter_type: AdsbEmitterType::DEFAULT,
5022 tslc: 0_u8,
5023 };
5024 #[cfg(feature = "arbitrary")]
5025 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5026 use arbitrary::{Arbitrary, Unstructured};
5027 let mut buf = [0u8; 1024];
5028 rng.fill_bytes(&mut buf);
5029 let mut unstructured = Unstructured::new(&buf);
5030 Self::arbitrary(&mut unstructured).unwrap_or_default()
5031 }
5032}
5033impl Default for ADSB_VEHICLE_DATA {
5034 fn default() -> Self {
5035 Self::DEFAULT.clone()
5036 }
5037}
5038impl MessageData for ADSB_VEHICLE_DATA {
5039 type Message = MavMessage;
5040 const ID: u32 = 246u32;
5041 const NAME: &'static str = "ADSB_VEHICLE";
5042 const EXTRA_CRC: u8 = 184u8;
5043 const ENCODED_LEN: usize = 38usize;
5044 fn deser(
5045 _version: MavlinkVersion,
5046 __input: &[u8],
5047 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5048 let avail_len = __input.len();
5049 let mut payload_buf = [0; Self::ENCODED_LEN];
5050 let mut buf = if avail_len < Self::ENCODED_LEN {
5051 payload_buf[0..avail_len].copy_from_slice(__input);
5052 Bytes::new(&payload_buf)
5053 } else {
5054 Bytes::new(__input)
5055 };
5056 let mut __struct = Self::default();
5057 __struct.ICAO_address = buf.get_u32_le();
5058 __struct.lat = buf.get_i32_le();
5059 __struct.lon = buf.get_i32_le();
5060 __struct.altitude = buf.get_i32_le();
5061 __struct.heading = buf.get_u16_le();
5062 __struct.hor_velocity = buf.get_u16_le();
5063 __struct.ver_velocity = buf.get_i16_le();
5064 let tmp = buf.get_u16_le();
5065 __struct.flags = AdsbFlags::from_bits(tmp & AdsbFlags::all().bits()).ok_or(
5066 ::mavlink_core::error::ParserError::InvalidFlag {
5067 flag_type: "AdsbFlags",
5068 value: tmp as u32,
5069 },
5070 )?;
5071 __struct.squawk = buf.get_u16_le();
5072 let tmp = buf.get_u8();
5073 __struct.altitude_type =
5074 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
5075 enum_type: "AdsbAltitudeType",
5076 value: tmp as u32,
5077 })?;
5078 for v in &mut __struct.callsign {
5079 let val = buf.get_u8();
5080 *v = val;
5081 }
5082 let tmp = buf.get_u8();
5083 __struct.emitter_type =
5084 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
5085 enum_type: "AdsbEmitterType",
5086 value: tmp as u32,
5087 })?;
5088 __struct.tslc = buf.get_u8();
5089 Ok(__struct)
5090 }
5091 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5092 let mut __tmp = BytesMut::new(bytes);
5093 #[allow(clippy::absurd_extreme_comparisons)]
5094 #[allow(unused_comparisons)]
5095 if __tmp.remaining() < Self::ENCODED_LEN {
5096 panic!(
5097 "buffer is too small (need {} bytes, but got {})",
5098 Self::ENCODED_LEN,
5099 __tmp.remaining(),
5100 )
5101 }
5102 __tmp.put_u32_le(self.ICAO_address);
5103 __tmp.put_i32_le(self.lat);
5104 __tmp.put_i32_le(self.lon);
5105 __tmp.put_i32_le(self.altitude);
5106 __tmp.put_u16_le(self.heading);
5107 __tmp.put_u16_le(self.hor_velocity);
5108 __tmp.put_i16_le(self.ver_velocity);
5109 __tmp.put_u16_le(self.flags.bits());
5110 __tmp.put_u16_le(self.squawk);
5111 __tmp.put_u8(self.altitude_type as u8);
5112 for val in &self.callsign {
5113 __tmp.put_u8(*val);
5114 }
5115 __tmp.put_u8(self.emitter_type as u8);
5116 __tmp.put_u8(self.tslc);
5117 if matches!(version, MavlinkVersion::V2) {
5118 let len = __tmp.len();
5119 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5120 } else {
5121 __tmp.len()
5122 }
5123 }
5124}
5125#[doc = "The location and information of an AIS vessel."]
5126#[doc = ""]
5127#[doc = "ID: 301"]
5128#[derive(Debug, Clone, PartialEq)]
5129#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5130#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5131#[cfg_attr(feature = "ts", derive(TS))]
5132#[cfg_attr(feature = "ts", ts(export))]
5133pub struct AIS_VESSEL_DATA {
5134 #[doc = "Mobile Marine Service Identifier, 9 decimal digits"]
5135 pub MMSI: u32,
5136 #[doc = "Latitude"]
5137 pub lat: i32,
5138 #[doc = "Longitude"]
5139 pub lon: i32,
5140 #[doc = "Course over ground"]
5141 pub COG: u16,
5142 #[doc = "True heading"]
5143 pub heading: u16,
5144 #[doc = "Speed over ground"]
5145 pub velocity: u16,
5146 #[doc = "Distance from lat/lon location to bow"]
5147 pub dimension_bow: u16,
5148 #[doc = "Distance from lat/lon location to stern"]
5149 pub dimension_stern: u16,
5150 #[doc = "Time since last communication in seconds"]
5151 pub tslc: u16,
5152 #[doc = "Bitmask to indicate various statuses including valid data fields"]
5153 pub flags: AisFlags,
5154 #[doc = "Turn rate"]
5155 pub turn_rate: i8,
5156 #[doc = "Navigational status"]
5157 pub navigational_status: AisNavStatus,
5158 #[doc = "Type of vessels"]
5159 pub mavtype: AisType,
5160 #[doc = "Distance from lat/lon location to port side"]
5161 pub dimension_port: u8,
5162 #[doc = "Distance from lat/lon location to starboard side"]
5163 pub dimension_starboard: u8,
5164 #[doc = "The vessel callsign"]
5165 #[cfg_attr(
5166 feature = "serde",
5167 serde(
5168 serialize_with = "crate::nulstr::serialize::<_, 7>",
5169 deserialize_with = "crate::nulstr::deserialize::<_, 7>"
5170 )
5171 )]
5172 #[cfg_attr(feature = "ts", ts(type = "string"))]
5173 pub callsign: [u8; 7],
5174 #[doc = "The vessel name"]
5175 #[cfg_attr(
5176 feature = "serde",
5177 serde(
5178 serialize_with = "crate::nulstr::serialize::<_, 20>",
5179 deserialize_with = "crate::nulstr::deserialize::<_, 20>"
5180 )
5181 )]
5182 #[cfg_attr(feature = "ts", ts(type = "string"))]
5183 pub name: [u8; 20],
5184}
5185impl AIS_VESSEL_DATA {
5186 pub const ENCODED_LEN: usize = 58usize;
5187 pub const DEFAULT: Self = Self {
5188 MMSI: 0_u32,
5189 lat: 0_i32,
5190 lon: 0_i32,
5191 COG: 0_u16,
5192 heading: 0_u16,
5193 velocity: 0_u16,
5194 dimension_bow: 0_u16,
5195 dimension_stern: 0_u16,
5196 tslc: 0_u16,
5197 flags: AisFlags::DEFAULT,
5198 turn_rate: 0_i8,
5199 navigational_status: AisNavStatus::DEFAULT,
5200 mavtype: AisType::DEFAULT,
5201 dimension_port: 0_u8,
5202 dimension_starboard: 0_u8,
5203 callsign: [0_u8; 7usize],
5204 name: [0_u8; 20usize],
5205 };
5206 #[cfg(feature = "arbitrary")]
5207 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5208 use arbitrary::{Arbitrary, Unstructured};
5209 let mut buf = [0u8; 1024];
5210 rng.fill_bytes(&mut buf);
5211 let mut unstructured = Unstructured::new(&buf);
5212 Self::arbitrary(&mut unstructured).unwrap_or_default()
5213 }
5214}
5215impl Default for AIS_VESSEL_DATA {
5216 fn default() -> Self {
5217 Self::DEFAULT.clone()
5218 }
5219}
5220impl MessageData for AIS_VESSEL_DATA {
5221 type Message = MavMessage;
5222 const ID: u32 = 301u32;
5223 const NAME: &'static str = "AIS_VESSEL";
5224 const EXTRA_CRC: u8 = 243u8;
5225 const ENCODED_LEN: usize = 58usize;
5226 fn deser(
5227 _version: MavlinkVersion,
5228 __input: &[u8],
5229 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5230 let avail_len = __input.len();
5231 let mut payload_buf = [0; Self::ENCODED_LEN];
5232 let mut buf = if avail_len < Self::ENCODED_LEN {
5233 payload_buf[0..avail_len].copy_from_slice(__input);
5234 Bytes::new(&payload_buf)
5235 } else {
5236 Bytes::new(__input)
5237 };
5238 let mut __struct = Self::default();
5239 __struct.MMSI = buf.get_u32_le();
5240 __struct.lat = buf.get_i32_le();
5241 __struct.lon = buf.get_i32_le();
5242 __struct.COG = buf.get_u16_le();
5243 __struct.heading = buf.get_u16_le();
5244 __struct.velocity = buf.get_u16_le();
5245 __struct.dimension_bow = buf.get_u16_le();
5246 __struct.dimension_stern = buf.get_u16_le();
5247 __struct.tslc = buf.get_u16_le();
5248 let tmp = buf.get_u16_le();
5249 __struct.flags = AisFlags::from_bits(tmp & AisFlags::all().bits()).ok_or(
5250 ::mavlink_core::error::ParserError::InvalidFlag {
5251 flag_type: "AisFlags",
5252 value: tmp as u32,
5253 },
5254 )?;
5255 __struct.turn_rate = buf.get_i8();
5256 let tmp = buf.get_u8();
5257 __struct.navigational_status =
5258 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
5259 enum_type: "AisNavStatus",
5260 value: tmp as u32,
5261 })?;
5262 let tmp = buf.get_u8();
5263 __struct.mavtype =
5264 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
5265 enum_type: "AisType",
5266 value: tmp as u32,
5267 })?;
5268 __struct.dimension_port = buf.get_u8();
5269 __struct.dimension_starboard = buf.get_u8();
5270 for v in &mut __struct.callsign {
5271 let val = buf.get_u8();
5272 *v = val;
5273 }
5274 for v in &mut __struct.name {
5275 let val = buf.get_u8();
5276 *v = val;
5277 }
5278 Ok(__struct)
5279 }
5280 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5281 let mut __tmp = BytesMut::new(bytes);
5282 #[allow(clippy::absurd_extreme_comparisons)]
5283 #[allow(unused_comparisons)]
5284 if __tmp.remaining() < Self::ENCODED_LEN {
5285 panic!(
5286 "buffer is too small (need {} bytes, but got {})",
5287 Self::ENCODED_LEN,
5288 __tmp.remaining(),
5289 )
5290 }
5291 __tmp.put_u32_le(self.MMSI);
5292 __tmp.put_i32_le(self.lat);
5293 __tmp.put_i32_le(self.lon);
5294 __tmp.put_u16_le(self.COG);
5295 __tmp.put_u16_le(self.heading);
5296 __tmp.put_u16_le(self.velocity);
5297 __tmp.put_u16_le(self.dimension_bow);
5298 __tmp.put_u16_le(self.dimension_stern);
5299 __tmp.put_u16_le(self.tslc);
5300 __tmp.put_u16_le(self.flags.bits());
5301 __tmp.put_i8(self.turn_rate);
5302 __tmp.put_u8(self.navigational_status as u8);
5303 __tmp.put_u8(self.mavtype as u8);
5304 __tmp.put_u8(self.dimension_port);
5305 __tmp.put_u8(self.dimension_starboard);
5306 for val in &self.callsign {
5307 __tmp.put_u8(*val);
5308 }
5309 for val in &self.name {
5310 __tmp.put_u8(*val);
5311 }
5312 if matches!(version, MavlinkVersion::V2) {
5313 let len = __tmp.len();
5314 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5315 } else {
5316 __tmp.len()
5317 }
5318 }
5319}
5320#[doc = "The current system altitude."]
5321#[doc = ""]
5322#[doc = "ID: 141"]
5323#[derive(Debug, Clone, PartialEq)]
5324#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5325#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5326#[cfg_attr(feature = "ts", derive(TS))]
5327#[cfg_attr(feature = "ts", ts(export))]
5328pub struct ALTITUDE_DATA {
5329 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5330 pub time_usec: u64,
5331 #[doc = "This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights."]
5332 pub altitude_monotonic: f32,
5333 #[doc = "This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output MSL by default and not the WGS84 altitude."]
5334 pub altitude_amsl: f32,
5335 #[doc = "This is the local altitude in the local coordinate frame. It is not the altitude above home, but in reference to the coordinate origin (0, 0, 0). It is up-positive."]
5336 pub altitude_local: f32,
5337 #[doc = "This is the altitude above the home position. It resets on each change of the current home position."]
5338 pub altitude_relative: f32,
5339 #[doc = "This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown."]
5340 pub altitude_terrain: f32,
5341 #[doc = "This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available."]
5342 pub bottom_clearance: f32,
5343}
5344impl ALTITUDE_DATA {
5345 pub const ENCODED_LEN: usize = 32usize;
5346 pub const DEFAULT: Self = Self {
5347 time_usec: 0_u64,
5348 altitude_monotonic: 0.0_f32,
5349 altitude_amsl: 0.0_f32,
5350 altitude_local: 0.0_f32,
5351 altitude_relative: 0.0_f32,
5352 altitude_terrain: 0.0_f32,
5353 bottom_clearance: 0.0_f32,
5354 };
5355 #[cfg(feature = "arbitrary")]
5356 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5357 use arbitrary::{Arbitrary, Unstructured};
5358 let mut buf = [0u8; 1024];
5359 rng.fill_bytes(&mut buf);
5360 let mut unstructured = Unstructured::new(&buf);
5361 Self::arbitrary(&mut unstructured).unwrap_or_default()
5362 }
5363}
5364impl Default for ALTITUDE_DATA {
5365 fn default() -> Self {
5366 Self::DEFAULT.clone()
5367 }
5368}
5369impl MessageData for ALTITUDE_DATA {
5370 type Message = MavMessage;
5371 const ID: u32 = 141u32;
5372 const NAME: &'static str = "ALTITUDE";
5373 const EXTRA_CRC: u8 = 47u8;
5374 const ENCODED_LEN: usize = 32usize;
5375 fn deser(
5376 _version: MavlinkVersion,
5377 __input: &[u8],
5378 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5379 let avail_len = __input.len();
5380 let mut payload_buf = [0; Self::ENCODED_LEN];
5381 let mut buf = if avail_len < Self::ENCODED_LEN {
5382 payload_buf[0..avail_len].copy_from_slice(__input);
5383 Bytes::new(&payload_buf)
5384 } else {
5385 Bytes::new(__input)
5386 };
5387 let mut __struct = Self::default();
5388 __struct.time_usec = buf.get_u64_le();
5389 __struct.altitude_monotonic = buf.get_f32_le();
5390 __struct.altitude_amsl = buf.get_f32_le();
5391 __struct.altitude_local = buf.get_f32_le();
5392 __struct.altitude_relative = buf.get_f32_le();
5393 __struct.altitude_terrain = buf.get_f32_le();
5394 __struct.bottom_clearance = buf.get_f32_le();
5395 Ok(__struct)
5396 }
5397 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5398 let mut __tmp = BytesMut::new(bytes);
5399 #[allow(clippy::absurd_extreme_comparisons)]
5400 #[allow(unused_comparisons)]
5401 if __tmp.remaining() < Self::ENCODED_LEN {
5402 panic!(
5403 "buffer is too small (need {} bytes, but got {})",
5404 Self::ENCODED_LEN,
5405 __tmp.remaining(),
5406 )
5407 }
5408 __tmp.put_u64_le(self.time_usec);
5409 __tmp.put_f32_le(self.altitude_monotonic);
5410 __tmp.put_f32_le(self.altitude_amsl);
5411 __tmp.put_f32_le(self.altitude_local);
5412 __tmp.put_f32_le(self.altitude_relative);
5413 __tmp.put_f32_le(self.altitude_terrain);
5414 __tmp.put_f32_le(self.bottom_clearance);
5415 if matches!(version, MavlinkVersion::V2) {
5416 let len = __tmp.len();
5417 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5418 } else {
5419 __tmp.len()
5420 }
5421 }
5422}
5423#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, Y-right, X-front, ZYX, intrinsic)."]
5424#[doc = ""]
5425#[doc = "ID: 30"]
5426#[derive(Debug, Clone, PartialEq)]
5427#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5428#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5429#[cfg_attr(feature = "ts", derive(TS))]
5430#[cfg_attr(feature = "ts", ts(export))]
5431pub struct ATTITUDE_DATA {
5432 #[doc = "Timestamp (time since system boot)."]
5433 pub time_boot_ms: u32,
5434 #[doc = "Roll angle (-pi..+pi)"]
5435 pub roll: f32,
5436 #[doc = "Pitch angle (-pi..+pi)"]
5437 pub pitch: f32,
5438 #[doc = "Yaw angle (-pi..+pi)"]
5439 pub yaw: f32,
5440 #[doc = "Roll angular speed"]
5441 pub rollspeed: f32,
5442 #[doc = "Pitch angular speed"]
5443 pub pitchspeed: f32,
5444 #[doc = "Yaw angular speed"]
5445 pub yawspeed: f32,
5446}
5447impl ATTITUDE_DATA {
5448 pub const ENCODED_LEN: usize = 28usize;
5449 pub const DEFAULT: Self = Self {
5450 time_boot_ms: 0_u32,
5451 roll: 0.0_f32,
5452 pitch: 0.0_f32,
5453 yaw: 0.0_f32,
5454 rollspeed: 0.0_f32,
5455 pitchspeed: 0.0_f32,
5456 yawspeed: 0.0_f32,
5457 };
5458 #[cfg(feature = "arbitrary")]
5459 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5460 use arbitrary::{Arbitrary, Unstructured};
5461 let mut buf = [0u8; 1024];
5462 rng.fill_bytes(&mut buf);
5463 let mut unstructured = Unstructured::new(&buf);
5464 Self::arbitrary(&mut unstructured).unwrap_or_default()
5465 }
5466}
5467impl Default for ATTITUDE_DATA {
5468 fn default() -> Self {
5469 Self::DEFAULT.clone()
5470 }
5471}
5472impl MessageData for ATTITUDE_DATA {
5473 type Message = MavMessage;
5474 const ID: u32 = 30u32;
5475 const NAME: &'static str = "ATTITUDE";
5476 const EXTRA_CRC: u8 = 39u8;
5477 const ENCODED_LEN: usize = 28usize;
5478 fn deser(
5479 _version: MavlinkVersion,
5480 __input: &[u8],
5481 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5482 let avail_len = __input.len();
5483 let mut payload_buf = [0; Self::ENCODED_LEN];
5484 let mut buf = if avail_len < Self::ENCODED_LEN {
5485 payload_buf[0..avail_len].copy_from_slice(__input);
5486 Bytes::new(&payload_buf)
5487 } else {
5488 Bytes::new(__input)
5489 };
5490 let mut __struct = Self::default();
5491 __struct.time_boot_ms = buf.get_u32_le();
5492 __struct.roll = buf.get_f32_le();
5493 __struct.pitch = buf.get_f32_le();
5494 __struct.yaw = buf.get_f32_le();
5495 __struct.rollspeed = buf.get_f32_le();
5496 __struct.pitchspeed = buf.get_f32_le();
5497 __struct.yawspeed = buf.get_f32_le();
5498 Ok(__struct)
5499 }
5500 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5501 let mut __tmp = BytesMut::new(bytes);
5502 #[allow(clippy::absurd_extreme_comparisons)]
5503 #[allow(unused_comparisons)]
5504 if __tmp.remaining() < Self::ENCODED_LEN {
5505 panic!(
5506 "buffer is too small (need {} bytes, but got {})",
5507 Self::ENCODED_LEN,
5508 __tmp.remaining(),
5509 )
5510 }
5511 __tmp.put_u32_le(self.time_boot_ms);
5512 __tmp.put_f32_le(self.roll);
5513 __tmp.put_f32_le(self.pitch);
5514 __tmp.put_f32_le(self.yaw);
5515 __tmp.put_f32_le(self.rollspeed);
5516 __tmp.put_f32_le(self.pitchspeed);
5517 __tmp.put_f32_le(self.yawspeed);
5518 if matches!(version, MavlinkVersion::V2) {
5519 let len = __tmp.len();
5520 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5521 } else {
5522 __tmp.len()
5523 }
5524 }
5525}
5526#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
5527#[doc = ""]
5528#[doc = "ID: 31"]
5529#[derive(Debug, Clone, PartialEq)]
5530#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5531#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5532#[cfg_attr(feature = "ts", derive(TS))]
5533#[cfg_attr(feature = "ts", ts(export))]
5534pub struct ATTITUDE_QUATERNION_DATA {
5535 #[doc = "Timestamp (time since system boot)."]
5536 pub time_boot_ms: u32,
5537 #[doc = "Quaternion component 1, w (1 in null-rotation)"]
5538 pub q1: f32,
5539 #[doc = "Quaternion component 2, x (0 in null-rotation)"]
5540 pub q2: f32,
5541 #[doc = "Quaternion component 3, y (0 in null-rotation)"]
5542 pub q3: f32,
5543 #[doc = "Quaternion component 4, z (0 in null-rotation)"]
5544 pub q4: f32,
5545 #[doc = "Roll angular speed"]
5546 pub rollspeed: f32,
5547 #[doc = "Pitch angular speed"]
5548 pub pitchspeed: f32,
5549 #[doc = "Yaw angular speed"]
5550 pub yawspeed: f32,
5551 #[doc = "Rotation offset by which the attitude quaternion and angular speed vector should be rotated for user display (quaternion with [w, x, y, z] order, zero-rotation is [1, 0, 0, 0], send [0, 0, 0, 0] if field not supported). This field is intended for systems in which the reference attitude may change during flight. For example, tailsitters VTOLs rotate their reference attitude by 90 degrees between hover mode and fixed wing mode, thus repr_offset_q is equal to [1, 0, 0, 0] in hover mode and equal to [0.7071, 0, 0.7071, 0] in fixed wing mode."]
5552 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5553 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5554 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5555 pub repr_offset_q: [f32; 4],
5556}
5557impl ATTITUDE_QUATERNION_DATA {
5558 pub const ENCODED_LEN: usize = 48usize;
5559 pub const DEFAULT: Self = Self {
5560 time_boot_ms: 0_u32,
5561 q1: 0.0_f32,
5562 q2: 0.0_f32,
5563 q3: 0.0_f32,
5564 q4: 0.0_f32,
5565 rollspeed: 0.0_f32,
5566 pitchspeed: 0.0_f32,
5567 yawspeed: 0.0_f32,
5568 repr_offset_q: [0.0_f32; 4usize],
5569 };
5570 #[cfg(feature = "arbitrary")]
5571 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5572 use arbitrary::{Arbitrary, Unstructured};
5573 let mut buf = [0u8; 1024];
5574 rng.fill_bytes(&mut buf);
5575 let mut unstructured = Unstructured::new(&buf);
5576 Self::arbitrary(&mut unstructured).unwrap_or_default()
5577 }
5578}
5579impl Default for ATTITUDE_QUATERNION_DATA {
5580 fn default() -> Self {
5581 Self::DEFAULT.clone()
5582 }
5583}
5584impl MessageData for ATTITUDE_QUATERNION_DATA {
5585 type Message = MavMessage;
5586 const ID: u32 = 31u32;
5587 const NAME: &'static str = "ATTITUDE_QUATERNION";
5588 const EXTRA_CRC: u8 = 246u8;
5589 const ENCODED_LEN: usize = 48usize;
5590 fn deser(
5591 _version: MavlinkVersion,
5592 __input: &[u8],
5593 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5594 let avail_len = __input.len();
5595 let mut payload_buf = [0; Self::ENCODED_LEN];
5596 let mut buf = if avail_len < Self::ENCODED_LEN {
5597 payload_buf[0..avail_len].copy_from_slice(__input);
5598 Bytes::new(&payload_buf)
5599 } else {
5600 Bytes::new(__input)
5601 };
5602 let mut __struct = Self::default();
5603 __struct.time_boot_ms = buf.get_u32_le();
5604 __struct.q1 = buf.get_f32_le();
5605 __struct.q2 = buf.get_f32_le();
5606 __struct.q3 = buf.get_f32_le();
5607 __struct.q4 = buf.get_f32_le();
5608 __struct.rollspeed = buf.get_f32_le();
5609 __struct.pitchspeed = buf.get_f32_le();
5610 __struct.yawspeed = buf.get_f32_le();
5611 for v in &mut __struct.repr_offset_q {
5612 let val = buf.get_f32_le();
5613 *v = val;
5614 }
5615 Ok(__struct)
5616 }
5617 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5618 let mut __tmp = BytesMut::new(bytes);
5619 #[allow(clippy::absurd_extreme_comparisons)]
5620 #[allow(unused_comparisons)]
5621 if __tmp.remaining() < Self::ENCODED_LEN {
5622 panic!(
5623 "buffer is too small (need {} bytes, but got {})",
5624 Self::ENCODED_LEN,
5625 __tmp.remaining(),
5626 )
5627 }
5628 __tmp.put_u32_le(self.time_boot_ms);
5629 __tmp.put_f32_le(self.q1);
5630 __tmp.put_f32_le(self.q2);
5631 __tmp.put_f32_le(self.q3);
5632 __tmp.put_f32_le(self.q4);
5633 __tmp.put_f32_le(self.rollspeed);
5634 __tmp.put_f32_le(self.pitchspeed);
5635 __tmp.put_f32_le(self.yawspeed);
5636 if matches!(version, MavlinkVersion::V2) {
5637 for val in &self.repr_offset_q {
5638 __tmp.put_f32_le(*val);
5639 }
5640 let len = __tmp.len();
5641 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5642 } else {
5643 __tmp.len()
5644 }
5645 }
5646}
5647#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
5648#[doc = ""]
5649#[doc = "ID: 61"]
5650#[derive(Debug, Clone, PartialEq)]
5651#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5652#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5653#[cfg_attr(feature = "ts", derive(TS))]
5654#[cfg_attr(feature = "ts", ts(export))]
5655pub struct ATTITUDE_QUATERNION_COV_DATA {
5656 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5657 pub time_usec: u64,
5658 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)"]
5659 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5660 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5661 pub q: [f32; 4],
5662 #[doc = "Roll angular speed"]
5663 pub rollspeed: f32,
5664 #[doc = "Pitch angular speed"]
5665 pub pitchspeed: f32,
5666 #[doc = "Yaw angular speed"]
5667 pub yawspeed: f32,
5668 #[doc = "Row-major representation of a 3x3 attitude covariance matrix (states: roll, pitch, yaw; first three entries are the first ROW, next three entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
5669 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5670 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5671 pub covariance: [f32; 9],
5672}
5673impl ATTITUDE_QUATERNION_COV_DATA {
5674 pub const ENCODED_LEN: usize = 72usize;
5675 pub const DEFAULT: Self = Self {
5676 time_usec: 0_u64,
5677 q: [0.0_f32; 4usize],
5678 rollspeed: 0.0_f32,
5679 pitchspeed: 0.0_f32,
5680 yawspeed: 0.0_f32,
5681 covariance: [0.0_f32; 9usize],
5682 };
5683 #[cfg(feature = "arbitrary")]
5684 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5685 use arbitrary::{Arbitrary, Unstructured};
5686 let mut buf = [0u8; 1024];
5687 rng.fill_bytes(&mut buf);
5688 let mut unstructured = Unstructured::new(&buf);
5689 Self::arbitrary(&mut unstructured).unwrap_or_default()
5690 }
5691}
5692impl Default for ATTITUDE_QUATERNION_COV_DATA {
5693 fn default() -> Self {
5694 Self::DEFAULT.clone()
5695 }
5696}
5697impl MessageData for ATTITUDE_QUATERNION_COV_DATA {
5698 type Message = MavMessage;
5699 const ID: u32 = 61u32;
5700 const NAME: &'static str = "ATTITUDE_QUATERNION_COV";
5701 const EXTRA_CRC: u8 = 167u8;
5702 const ENCODED_LEN: usize = 72usize;
5703 fn deser(
5704 _version: MavlinkVersion,
5705 __input: &[u8],
5706 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5707 let avail_len = __input.len();
5708 let mut payload_buf = [0; Self::ENCODED_LEN];
5709 let mut buf = if avail_len < Self::ENCODED_LEN {
5710 payload_buf[0..avail_len].copy_from_slice(__input);
5711 Bytes::new(&payload_buf)
5712 } else {
5713 Bytes::new(__input)
5714 };
5715 let mut __struct = Self::default();
5716 __struct.time_usec = buf.get_u64_le();
5717 for v in &mut __struct.q {
5718 let val = buf.get_f32_le();
5719 *v = val;
5720 }
5721 __struct.rollspeed = buf.get_f32_le();
5722 __struct.pitchspeed = buf.get_f32_le();
5723 __struct.yawspeed = buf.get_f32_le();
5724 for v in &mut __struct.covariance {
5725 let val = buf.get_f32_le();
5726 *v = val;
5727 }
5728 Ok(__struct)
5729 }
5730 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5731 let mut __tmp = BytesMut::new(bytes);
5732 #[allow(clippy::absurd_extreme_comparisons)]
5733 #[allow(unused_comparisons)]
5734 if __tmp.remaining() < Self::ENCODED_LEN {
5735 panic!(
5736 "buffer is too small (need {} bytes, but got {})",
5737 Self::ENCODED_LEN,
5738 __tmp.remaining(),
5739 )
5740 }
5741 __tmp.put_u64_le(self.time_usec);
5742 for val in &self.q {
5743 __tmp.put_f32_le(*val);
5744 }
5745 __tmp.put_f32_le(self.rollspeed);
5746 __tmp.put_f32_le(self.pitchspeed);
5747 __tmp.put_f32_le(self.yawspeed);
5748 for val in &self.covariance {
5749 __tmp.put_f32_le(*val);
5750 }
5751 if matches!(version, MavlinkVersion::V2) {
5752 let len = __tmp.len();
5753 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5754 } else {
5755 __tmp.len()
5756 }
5757 }
5758}
5759#[doc = "Reports the current commanded attitude of the vehicle as specified by the autopilot. This should match the commands sent in a SET_ATTITUDE_TARGET message if the vehicle is being controlled this way."]
5760#[doc = ""]
5761#[doc = "ID: 83"]
5762#[derive(Debug, Clone, PartialEq)]
5763#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5764#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5765#[cfg_attr(feature = "ts", derive(TS))]
5766#[cfg_attr(feature = "ts", ts(export))]
5767pub struct ATTITUDE_TARGET_DATA {
5768 #[doc = "Timestamp (time since system boot)."]
5769 pub time_boot_ms: u32,
5770 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
5771 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5772 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5773 pub q: [f32; 4],
5774 #[doc = "Body roll rate"]
5775 pub body_roll_rate: f32,
5776 #[doc = "Body pitch rate"]
5777 pub body_pitch_rate: f32,
5778 #[doc = "Body yaw rate"]
5779 pub body_yaw_rate: f32,
5780 #[doc = "Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)"]
5781 pub thrust: f32,
5782 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
5783 pub type_mask: AttitudeTargetTypemask,
5784}
5785impl ATTITUDE_TARGET_DATA {
5786 pub const ENCODED_LEN: usize = 37usize;
5787 pub const DEFAULT: Self = Self {
5788 time_boot_ms: 0_u32,
5789 q: [0.0_f32; 4usize],
5790 body_roll_rate: 0.0_f32,
5791 body_pitch_rate: 0.0_f32,
5792 body_yaw_rate: 0.0_f32,
5793 thrust: 0.0_f32,
5794 type_mask: AttitudeTargetTypemask::DEFAULT,
5795 };
5796 #[cfg(feature = "arbitrary")]
5797 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5798 use arbitrary::{Arbitrary, Unstructured};
5799 let mut buf = [0u8; 1024];
5800 rng.fill_bytes(&mut buf);
5801 let mut unstructured = Unstructured::new(&buf);
5802 Self::arbitrary(&mut unstructured).unwrap_or_default()
5803 }
5804}
5805impl Default for ATTITUDE_TARGET_DATA {
5806 fn default() -> Self {
5807 Self::DEFAULT.clone()
5808 }
5809}
5810impl MessageData for ATTITUDE_TARGET_DATA {
5811 type Message = MavMessage;
5812 const ID: u32 = 83u32;
5813 const NAME: &'static str = "ATTITUDE_TARGET";
5814 const EXTRA_CRC: u8 = 22u8;
5815 const ENCODED_LEN: usize = 37usize;
5816 fn deser(
5817 _version: MavlinkVersion,
5818 __input: &[u8],
5819 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5820 let avail_len = __input.len();
5821 let mut payload_buf = [0; Self::ENCODED_LEN];
5822 let mut buf = if avail_len < Self::ENCODED_LEN {
5823 payload_buf[0..avail_len].copy_from_slice(__input);
5824 Bytes::new(&payload_buf)
5825 } else {
5826 Bytes::new(__input)
5827 };
5828 let mut __struct = Self::default();
5829 __struct.time_boot_ms = buf.get_u32_le();
5830 for v in &mut __struct.q {
5831 let val = buf.get_f32_le();
5832 *v = val;
5833 }
5834 __struct.body_roll_rate = buf.get_f32_le();
5835 __struct.body_pitch_rate = buf.get_f32_le();
5836 __struct.body_yaw_rate = buf.get_f32_le();
5837 __struct.thrust = buf.get_f32_le();
5838 let tmp = buf.get_u8();
5839 __struct.type_mask = AttitudeTargetTypemask::from_bits(
5840 tmp & AttitudeTargetTypemask::all().bits(),
5841 )
5842 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
5843 flag_type: "AttitudeTargetTypemask",
5844 value: tmp as u32,
5845 })?;
5846 Ok(__struct)
5847 }
5848 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5849 let mut __tmp = BytesMut::new(bytes);
5850 #[allow(clippy::absurd_extreme_comparisons)]
5851 #[allow(unused_comparisons)]
5852 if __tmp.remaining() < Self::ENCODED_LEN {
5853 panic!(
5854 "buffer is too small (need {} bytes, but got {})",
5855 Self::ENCODED_LEN,
5856 __tmp.remaining(),
5857 )
5858 }
5859 __tmp.put_u32_le(self.time_boot_ms);
5860 for val in &self.q {
5861 __tmp.put_f32_le(*val);
5862 }
5863 __tmp.put_f32_le(self.body_roll_rate);
5864 __tmp.put_f32_le(self.body_pitch_rate);
5865 __tmp.put_f32_le(self.body_yaw_rate);
5866 __tmp.put_f32_le(self.thrust);
5867 __tmp.put_u8(self.type_mask.bits());
5868 if matches!(version, MavlinkVersion::V2) {
5869 let len = __tmp.len();
5870 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5871 } else {
5872 __tmp.len()
5873 }
5874 }
5875}
5876#[doc = "Motion capture attitude and position."]
5877#[doc = ""]
5878#[doc = "ID: 138"]
5879#[derive(Debug, Clone, PartialEq)]
5880#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5881#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5882#[cfg_attr(feature = "ts", derive(TS))]
5883#[cfg_attr(feature = "ts", ts(export))]
5884pub struct ATT_POS_MOCAP_DATA {
5885 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5886 pub time_usec: u64,
5887 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
5888 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5889 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5890 pub q: [f32; 4],
5891 #[doc = "X position (NED)"]
5892 pub x: f32,
5893 #[doc = "Y position (NED)"]
5894 pub y: f32,
5895 #[doc = "Z position (NED)"]
5896 pub z: f32,
5897 #[doc = "Row-major representation of a pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
5898 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5899 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5900 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5901 pub covariance: [f32; 21],
5902}
5903impl ATT_POS_MOCAP_DATA {
5904 pub const ENCODED_LEN: usize = 120usize;
5905 pub const DEFAULT: Self = Self {
5906 time_usec: 0_u64,
5907 q: [0.0_f32; 4usize],
5908 x: 0.0_f32,
5909 y: 0.0_f32,
5910 z: 0.0_f32,
5911 covariance: [0.0_f32; 21usize],
5912 };
5913 #[cfg(feature = "arbitrary")]
5914 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5915 use arbitrary::{Arbitrary, Unstructured};
5916 let mut buf = [0u8; 1024];
5917 rng.fill_bytes(&mut buf);
5918 let mut unstructured = Unstructured::new(&buf);
5919 Self::arbitrary(&mut unstructured).unwrap_or_default()
5920 }
5921}
5922impl Default for ATT_POS_MOCAP_DATA {
5923 fn default() -> Self {
5924 Self::DEFAULT.clone()
5925 }
5926}
5927impl MessageData for ATT_POS_MOCAP_DATA {
5928 type Message = MavMessage;
5929 const ID: u32 = 138u32;
5930 const NAME: &'static str = "ATT_POS_MOCAP";
5931 const EXTRA_CRC: u8 = 109u8;
5932 const ENCODED_LEN: usize = 120usize;
5933 fn deser(
5934 _version: MavlinkVersion,
5935 __input: &[u8],
5936 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5937 let avail_len = __input.len();
5938 let mut payload_buf = [0; Self::ENCODED_LEN];
5939 let mut buf = if avail_len < Self::ENCODED_LEN {
5940 payload_buf[0..avail_len].copy_from_slice(__input);
5941 Bytes::new(&payload_buf)
5942 } else {
5943 Bytes::new(__input)
5944 };
5945 let mut __struct = Self::default();
5946 __struct.time_usec = buf.get_u64_le();
5947 for v in &mut __struct.q {
5948 let val = buf.get_f32_le();
5949 *v = val;
5950 }
5951 __struct.x = buf.get_f32_le();
5952 __struct.y = buf.get_f32_le();
5953 __struct.z = buf.get_f32_le();
5954 for v in &mut __struct.covariance {
5955 let val = buf.get_f32_le();
5956 *v = val;
5957 }
5958 Ok(__struct)
5959 }
5960 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5961 let mut __tmp = BytesMut::new(bytes);
5962 #[allow(clippy::absurd_extreme_comparisons)]
5963 #[allow(unused_comparisons)]
5964 if __tmp.remaining() < Self::ENCODED_LEN {
5965 panic!(
5966 "buffer is too small (need {} bytes, but got {})",
5967 Self::ENCODED_LEN,
5968 __tmp.remaining(),
5969 )
5970 }
5971 __tmp.put_u64_le(self.time_usec);
5972 for val in &self.q {
5973 __tmp.put_f32_le(*val);
5974 }
5975 __tmp.put_f32_le(self.x);
5976 __tmp.put_f32_le(self.y);
5977 __tmp.put_f32_le(self.z);
5978 if matches!(version, MavlinkVersion::V2) {
5979 for val in &self.covariance {
5980 __tmp.put_f32_le(*val);
5981 }
5982 let len = __tmp.len();
5983 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5984 } else {
5985 __tmp.len()
5986 }
5987 }
5988}
5989#[doc = "Emit an encrypted signature / key identifying this system. PLEASE NOTE: This protocol has been kept simple, so transmitting the key requires an encrypted channel for true safety."]
5990#[doc = ""]
5991#[doc = "ID: 7"]
5992#[derive(Debug, Clone, PartialEq)]
5993#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5994#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5995#[cfg_attr(feature = "ts", derive(TS))]
5996#[cfg_attr(feature = "ts", ts(export))]
5997pub struct AUTH_KEY_DATA {
5998 #[doc = "key"]
5999 #[cfg_attr(
6000 feature = "serde",
6001 serde(
6002 serialize_with = "crate::nulstr::serialize::<_, 32>",
6003 deserialize_with = "crate::nulstr::deserialize::<_, 32>"
6004 )
6005 )]
6006 #[cfg_attr(feature = "ts", ts(type = "string"))]
6007 pub key: [u8; 32],
6008}
6009impl AUTH_KEY_DATA {
6010 pub const ENCODED_LEN: usize = 32usize;
6011 pub const DEFAULT: Self = Self {
6012 key: [0_u8; 32usize],
6013 };
6014 #[cfg(feature = "arbitrary")]
6015 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6016 use arbitrary::{Arbitrary, Unstructured};
6017 let mut buf = [0u8; 1024];
6018 rng.fill_bytes(&mut buf);
6019 let mut unstructured = Unstructured::new(&buf);
6020 Self::arbitrary(&mut unstructured).unwrap_or_default()
6021 }
6022}
6023impl Default for AUTH_KEY_DATA {
6024 fn default() -> Self {
6025 Self::DEFAULT.clone()
6026 }
6027}
6028impl MessageData for AUTH_KEY_DATA {
6029 type Message = MavMessage;
6030 const ID: u32 = 7u32;
6031 const NAME: &'static str = "AUTH_KEY";
6032 const EXTRA_CRC: u8 = 119u8;
6033 const ENCODED_LEN: usize = 32usize;
6034 fn deser(
6035 _version: MavlinkVersion,
6036 __input: &[u8],
6037 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6038 let avail_len = __input.len();
6039 let mut payload_buf = [0; Self::ENCODED_LEN];
6040 let mut buf = if avail_len < Self::ENCODED_LEN {
6041 payload_buf[0..avail_len].copy_from_slice(__input);
6042 Bytes::new(&payload_buf)
6043 } else {
6044 Bytes::new(__input)
6045 };
6046 let mut __struct = Self::default();
6047 for v in &mut __struct.key {
6048 let val = buf.get_u8();
6049 *v = val;
6050 }
6051 Ok(__struct)
6052 }
6053 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6054 let mut __tmp = BytesMut::new(bytes);
6055 #[allow(clippy::absurd_extreme_comparisons)]
6056 #[allow(unused_comparisons)]
6057 if __tmp.remaining() < Self::ENCODED_LEN {
6058 panic!(
6059 "buffer is too small (need {} bytes, but got {})",
6060 Self::ENCODED_LEN,
6061 __tmp.remaining(),
6062 )
6063 }
6064 for val in &self.key {
6065 __tmp.put_u8(*val);
6066 }
6067 if matches!(version, MavlinkVersion::V2) {
6068 let len = __tmp.len();
6069 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6070 } else {
6071 __tmp.len()
6072 }
6073 }
6074}
6075#[doc = "Low level message containing autopilot state relevant for a gimbal device. This message is to be sent from the autopilot to the gimbal device component. The data of this message are for the gimbal device's estimator corrections, in particular horizon compensation, as well as indicates autopilot control intentions, e.g. feed forward angular control in the z-axis."]
6076#[doc = ""]
6077#[doc = "ID: 286"]
6078#[derive(Debug, Clone, PartialEq)]
6079#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6080#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6081#[cfg_attr(feature = "ts", derive(TS))]
6082#[cfg_attr(feature = "ts", ts(export))]
6083pub struct AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
6084 #[doc = "Timestamp (time since system boot)."]
6085 pub time_boot_us: u64,
6086 #[doc = "Quaternion components of autopilot attitude: w, x, y, z (1 0 0 0 is the null-rotation, Hamilton convention)."]
6087 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6088 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6089 pub q: [f32; 4],
6090 #[doc = "Estimated delay of the attitude data. 0 if unknown."]
6091 pub q_estimated_delay_us: u32,
6092 #[doc = "X Speed in NED (North, East, Down). NAN if unknown."]
6093 pub vx: f32,
6094 #[doc = "Y Speed in NED (North, East, Down). NAN if unknown."]
6095 pub vy: f32,
6096 #[doc = "Z Speed in NED (North, East, Down). NAN if unknown."]
6097 pub vz: f32,
6098 #[doc = "Estimated delay of the speed data. 0 if unknown."]
6099 pub v_estimated_delay_us: u32,
6100 #[doc = "Feed forward Z component of angular velocity (positive: yawing to the right). NaN to be ignored. This is to indicate if the autopilot is actively yawing."]
6101 pub feed_forward_angular_velocity_z: f32,
6102 #[doc = "Bitmap indicating which estimator outputs are valid."]
6103 pub estimator_status: EstimatorStatusFlags,
6104 #[doc = "System ID"]
6105 pub target_system: u8,
6106 #[doc = "Component ID"]
6107 pub target_component: u8,
6108 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
6109 pub landed_state: MavLandedState,
6110 #[doc = "Z component of angular velocity in NED (North, East, Down). NaN if unknown."]
6111 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6112 pub angular_velocity_z: f32,
6113}
6114impl AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
6115 pub const ENCODED_LEN: usize = 57usize;
6116 pub const DEFAULT: Self = Self {
6117 time_boot_us: 0_u64,
6118 q: [0.0_f32; 4usize],
6119 q_estimated_delay_us: 0_u32,
6120 vx: 0.0_f32,
6121 vy: 0.0_f32,
6122 vz: 0.0_f32,
6123 v_estimated_delay_us: 0_u32,
6124 feed_forward_angular_velocity_z: 0.0_f32,
6125 estimator_status: EstimatorStatusFlags::DEFAULT,
6126 target_system: 0_u8,
6127 target_component: 0_u8,
6128 landed_state: MavLandedState::DEFAULT,
6129 angular_velocity_z: 0.0_f32,
6130 };
6131 #[cfg(feature = "arbitrary")]
6132 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6133 use arbitrary::{Arbitrary, Unstructured};
6134 let mut buf = [0u8; 1024];
6135 rng.fill_bytes(&mut buf);
6136 let mut unstructured = Unstructured::new(&buf);
6137 Self::arbitrary(&mut unstructured).unwrap_or_default()
6138 }
6139}
6140impl Default for AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
6141 fn default() -> Self {
6142 Self::DEFAULT.clone()
6143 }
6144}
6145impl MessageData for AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
6146 type Message = MavMessage;
6147 const ID: u32 = 286u32;
6148 const NAME: &'static str = "AUTOPILOT_STATE_FOR_GIMBAL_DEVICE";
6149 const EXTRA_CRC: u8 = 210u8;
6150 const ENCODED_LEN: usize = 57usize;
6151 fn deser(
6152 _version: MavlinkVersion,
6153 __input: &[u8],
6154 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6155 let avail_len = __input.len();
6156 let mut payload_buf = [0; Self::ENCODED_LEN];
6157 let mut buf = if avail_len < Self::ENCODED_LEN {
6158 payload_buf[0..avail_len].copy_from_slice(__input);
6159 Bytes::new(&payload_buf)
6160 } else {
6161 Bytes::new(__input)
6162 };
6163 let mut __struct = Self::default();
6164 __struct.time_boot_us = buf.get_u64_le();
6165 for v in &mut __struct.q {
6166 let val = buf.get_f32_le();
6167 *v = val;
6168 }
6169 __struct.q_estimated_delay_us = buf.get_u32_le();
6170 __struct.vx = buf.get_f32_le();
6171 __struct.vy = buf.get_f32_le();
6172 __struct.vz = buf.get_f32_le();
6173 __struct.v_estimated_delay_us = buf.get_u32_le();
6174 __struct.feed_forward_angular_velocity_z = buf.get_f32_le();
6175 let tmp = buf.get_u16_le();
6176 __struct.estimator_status = EstimatorStatusFlags::from_bits(
6177 tmp & EstimatorStatusFlags::all().bits(),
6178 )
6179 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6180 flag_type: "EstimatorStatusFlags",
6181 value: tmp as u32,
6182 })?;
6183 __struct.target_system = buf.get_u8();
6184 __struct.target_component = buf.get_u8();
6185 let tmp = buf.get_u8();
6186 __struct.landed_state =
6187 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6188 enum_type: "MavLandedState",
6189 value: tmp as u32,
6190 })?;
6191 __struct.angular_velocity_z = buf.get_f32_le();
6192 Ok(__struct)
6193 }
6194 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6195 let mut __tmp = BytesMut::new(bytes);
6196 #[allow(clippy::absurd_extreme_comparisons)]
6197 #[allow(unused_comparisons)]
6198 if __tmp.remaining() < Self::ENCODED_LEN {
6199 panic!(
6200 "buffer is too small (need {} bytes, but got {})",
6201 Self::ENCODED_LEN,
6202 __tmp.remaining(),
6203 )
6204 }
6205 __tmp.put_u64_le(self.time_boot_us);
6206 for val in &self.q {
6207 __tmp.put_f32_le(*val);
6208 }
6209 __tmp.put_u32_le(self.q_estimated_delay_us);
6210 __tmp.put_f32_le(self.vx);
6211 __tmp.put_f32_le(self.vy);
6212 __tmp.put_f32_le(self.vz);
6213 __tmp.put_u32_le(self.v_estimated_delay_us);
6214 __tmp.put_f32_le(self.feed_forward_angular_velocity_z);
6215 __tmp.put_u16_le(self.estimator_status.bits());
6216 __tmp.put_u8(self.target_system);
6217 __tmp.put_u8(self.target_component);
6218 __tmp.put_u8(self.landed_state as u8);
6219 if matches!(version, MavlinkVersion::V2) {
6220 __tmp.put_f32_le(self.angular_velocity_z);
6221 let len = __tmp.len();
6222 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6223 } else {
6224 __tmp.len()
6225 }
6226 }
6227}
6228#[doc = "Version and capability of autopilot software. This should be emitted in response to a request with MAV_CMD_REQUEST_MESSAGE."]
6229#[doc = ""]
6230#[doc = "ID: 148"]
6231#[derive(Debug, Clone, PartialEq)]
6232#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6233#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6234#[cfg_attr(feature = "ts", derive(TS))]
6235#[cfg_attr(feature = "ts", ts(export))]
6236pub struct AUTOPILOT_VERSION_DATA {
6237 #[doc = "Bitmap of capabilities"]
6238 pub capabilities: MavProtocolCapability,
6239 #[doc = "UID if provided by hardware (see uid2)"]
6240 pub uid: u64,
6241 #[doc = "Firmware version number. The field must be encoded as 4 bytes, where each byte (shown from MSB to LSB) is part of a semantic version: (major) (minor) (patch) (FIRMWARE_VERSION_TYPE)."]
6242 pub flight_sw_version: u32,
6243 #[doc = "Middleware version number"]
6244 pub middleware_sw_version: u32,
6245 #[doc = "Operating system version number"]
6246 pub os_sw_version: u32,
6247 #[doc = "HW / board version (last 8 bits should be silicon ID, if any). The first 16 bits of this field specify <https://github.com/PX4/PX4-Bootloader/blob/master/board_types.txt>"]
6248 pub board_version: u32,
6249 #[doc = "ID of the board vendor"]
6250 pub vendor_id: u16,
6251 #[doc = "ID of the product"]
6252 pub product_id: u16,
6253 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
6254 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6255 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6256 pub flight_custom_version: [u8; 8],
6257 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
6258 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6259 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6260 pub middleware_custom_version: [u8; 8],
6261 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
6262 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6263 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6264 pub os_custom_version: [u8; 8],
6265 #[doc = "UID if provided by hardware (supersedes the uid field. If this is non-zero, use this field, otherwise use uid)"]
6266 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6267 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6268 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6269 pub uid2: [u8; 18],
6270}
6271impl AUTOPILOT_VERSION_DATA {
6272 pub const ENCODED_LEN: usize = 78usize;
6273 pub const DEFAULT: Self = Self {
6274 capabilities: MavProtocolCapability::DEFAULT,
6275 uid: 0_u64,
6276 flight_sw_version: 0_u32,
6277 middleware_sw_version: 0_u32,
6278 os_sw_version: 0_u32,
6279 board_version: 0_u32,
6280 vendor_id: 0_u16,
6281 product_id: 0_u16,
6282 flight_custom_version: [0_u8; 8usize],
6283 middleware_custom_version: [0_u8; 8usize],
6284 os_custom_version: [0_u8; 8usize],
6285 uid2: [0_u8; 18usize],
6286 };
6287 #[cfg(feature = "arbitrary")]
6288 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6289 use arbitrary::{Arbitrary, Unstructured};
6290 let mut buf = [0u8; 1024];
6291 rng.fill_bytes(&mut buf);
6292 let mut unstructured = Unstructured::new(&buf);
6293 Self::arbitrary(&mut unstructured).unwrap_or_default()
6294 }
6295}
6296impl Default for AUTOPILOT_VERSION_DATA {
6297 fn default() -> Self {
6298 Self::DEFAULT.clone()
6299 }
6300}
6301impl MessageData for AUTOPILOT_VERSION_DATA {
6302 type Message = MavMessage;
6303 const ID: u32 = 148u32;
6304 const NAME: &'static str = "AUTOPILOT_VERSION";
6305 const EXTRA_CRC: u8 = 178u8;
6306 const ENCODED_LEN: usize = 78usize;
6307 fn deser(
6308 _version: MavlinkVersion,
6309 __input: &[u8],
6310 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6311 let avail_len = __input.len();
6312 let mut payload_buf = [0; Self::ENCODED_LEN];
6313 let mut buf = if avail_len < Self::ENCODED_LEN {
6314 payload_buf[0..avail_len].copy_from_slice(__input);
6315 Bytes::new(&payload_buf)
6316 } else {
6317 Bytes::new(__input)
6318 };
6319 let mut __struct = Self::default();
6320 let tmp = buf.get_u64_le();
6321 __struct.capabilities = MavProtocolCapability::from_bits(
6322 tmp & MavProtocolCapability::all().bits(),
6323 )
6324 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6325 flag_type: "MavProtocolCapability",
6326 value: tmp as u32,
6327 })?;
6328 __struct.uid = buf.get_u64_le();
6329 __struct.flight_sw_version = buf.get_u32_le();
6330 __struct.middleware_sw_version = buf.get_u32_le();
6331 __struct.os_sw_version = buf.get_u32_le();
6332 __struct.board_version = buf.get_u32_le();
6333 __struct.vendor_id = buf.get_u16_le();
6334 __struct.product_id = buf.get_u16_le();
6335 for v in &mut __struct.flight_custom_version {
6336 let val = buf.get_u8();
6337 *v = val;
6338 }
6339 for v in &mut __struct.middleware_custom_version {
6340 let val = buf.get_u8();
6341 *v = val;
6342 }
6343 for v in &mut __struct.os_custom_version {
6344 let val = buf.get_u8();
6345 *v = val;
6346 }
6347 for v in &mut __struct.uid2 {
6348 let val = buf.get_u8();
6349 *v = val;
6350 }
6351 Ok(__struct)
6352 }
6353 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6354 let mut __tmp = BytesMut::new(bytes);
6355 #[allow(clippy::absurd_extreme_comparisons)]
6356 #[allow(unused_comparisons)]
6357 if __tmp.remaining() < Self::ENCODED_LEN {
6358 panic!(
6359 "buffer is too small (need {} bytes, but got {})",
6360 Self::ENCODED_LEN,
6361 __tmp.remaining(),
6362 )
6363 }
6364 __tmp.put_u64_le(self.capabilities.bits());
6365 __tmp.put_u64_le(self.uid);
6366 __tmp.put_u32_le(self.flight_sw_version);
6367 __tmp.put_u32_le(self.middleware_sw_version);
6368 __tmp.put_u32_le(self.os_sw_version);
6369 __tmp.put_u32_le(self.board_version);
6370 __tmp.put_u16_le(self.vendor_id);
6371 __tmp.put_u16_le(self.product_id);
6372 for val in &self.flight_custom_version {
6373 __tmp.put_u8(*val);
6374 }
6375 for val in &self.middleware_custom_version {
6376 __tmp.put_u8(*val);
6377 }
6378 for val in &self.os_custom_version {
6379 __tmp.put_u8(*val);
6380 }
6381 if matches!(version, MavlinkVersion::V2) {
6382 for val in &self.uid2 {
6383 __tmp.put_u8(*val);
6384 }
6385 let len = __tmp.len();
6386 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6387 } else {
6388 __tmp.len()
6389 }
6390 }
6391}
6392#[doc = "Information about a flight mode. The message can be enumerated to get information for all modes, or requested for a particular mode, using MAV_CMD_REQUEST_MESSAGE. Specify 0 in param2 to request that the message is emitted for all available modes or the specific index for just one mode. The modes must be available/settable for the current vehicle/frame type. Each mode should only be emitted once (even if it is both standard and custom). Note that the current mode should be emitted in CURRENT_MODE, and that if the mode list can change then AVAILABLE_MODES_MONITOR must be emitted on first change and subsequently streamed. See <https://mavlink.io/en/services/standard_modes.html>."]
6393#[doc = ""]
6394#[doc = "ID: 435"]
6395#[derive(Debug, Clone, PartialEq)]
6396#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6397#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6398#[cfg_attr(feature = "ts", derive(TS))]
6399#[cfg_attr(feature = "ts", ts(export))]
6400pub struct AVAILABLE_MODES_DATA {
6401 #[doc = "A bitfield for use for autopilot-specific flags"]
6402 pub custom_mode: u32,
6403 #[doc = "Mode properties."]
6404 pub properties: MavModeProperty,
6405 #[doc = "The total number of available modes for the current vehicle type."]
6406 pub number_modes: u8,
6407 #[doc = "The current mode index within number_modes, indexed from 1. The index is not guaranteed to be persistent, and may change between reboots or if the set of modes change."]
6408 pub mode_index: u8,
6409 #[doc = "Standard mode."]
6410 pub standard_mode: MavStandardMode,
6411 #[doc = "Name of custom mode, with null termination character. Should be omitted for standard modes."]
6412 #[cfg_attr(
6413 feature = "serde",
6414 serde(
6415 serialize_with = "crate::nulstr::serialize::<_, 35>",
6416 deserialize_with = "crate::nulstr::deserialize::<_, 35>"
6417 )
6418 )]
6419 #[cfg_attr(feature = "ts", ts(type = "string"))]
6420 pub mode_name: [u8; 35],
6421}
6422impl AVAILABLE_MODES_DATA {
6423 pub const ENCODED_LEN: usize = 46usize;
6424 pub const DEFAULT: Self = Self {
6425 custom_mode: 0_u32,
6426 properties: MavModeProperty::DEFAULT,
6427 number_modes: 0_u8,
6428 mode_index: 0_u8,
6429 standard_mode: MavStandardMode::DEFAULT,
6430 mode_name: [0_u8; 35usize],
6431 };
6432 #[cfg(feature = "arbitrary")]
6433 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6434 use arbitrary::{Arbitrary, Unstructured};
6435 let mut buf = [0u8; 1024];
6436 rng.fill_bytes(&mut buf);
6437 let mut unstructured = Unstructured::new(&buf);
6438 Self::arbitrary(&mut unstructured).unwrap_or_default()
6439 }
6440}
6441impl Default for AVAILABLE_MODES_DATA {
6442 fn default() -> Self {
6443 Self::DEFAULT.clone()
6444 }
6445}
6446impl MessageData for AVAILABLE_MODES_DATA {
6447 type Message = MavMessage;
6448 const ID: u32 = 435u32;
6449 const NAME: &'static str = "AVAILABLE_MODES";
6450 const EXTRA_CRC: u8 = 134u8;
6451 const ENCODED_LEN: usize = 46usize;
6452 fn deser(
6453 _version: MavlinkVersion,
6454 __input: &[u8],
6455 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6456 let avail_len = __input.len();
6457 let mut payload_buf = [0; Self::ENCODED_LEN];
6458 let mut buf = if avail_len < Self::ENCODED_LEN {
6459 payload_buf[0..avail_len].copy_from_slice(__input);
6460 Bytes::new(&payload_buf)
6461 } else {
6462 Bytes::new(__input)
6463 };
6464 let mut __struct = Self::default();
6465 __struct.custom_mode = buf.get_u32_le();
6466 let tmp = buf.get_u32_le();
6467 __struct.properties = MavModeProperty::from_bits(tmp & MavModeProperty::all().bits())
6468 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6469 flag_type: "MavModeProperty",
6470 value: tmp as u32,
6471 })?;
6472 __struct.number_modes = buf.get_u8();
6473 __struct.mode_index = buf.get_u8();
6474 let tmp = buf.get_u8();
6475 __struct.standard_mode =
6476 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6477 enum_type: "MavStandardMode",
6478 value: tmp as u32,
6479 })?;
6480 for v in &mut __struct.mode_name {
6481 let val = buf.get_u8();
6482 *v = val;
6483 }
6484 Ok(__struct)
6485 }
6486 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6487 let mut __tmp = BytesMut::new(bytes);
6488 #[allow(clippy::absurd_extreme_comparisons)]
6489 #[allow(unused_comparisons)]
6490 if __tmp.remaining() < Self::ENCODED_LEN {
6491 panic!(
6492 "buffer is too small (need {} bytes, but got {})",
6493 Self::ENCODED_LEN,
6494 __tmp.remaining(),
6495 )
6496 }
6497 __tmp.put_u32_le(self.custom_mode);
6498 __tmp.put_u32_le(self.properties.bits());
6499 __tmp.put_u8(self.number_modes);
6500 __tmp.put_u8(self.mode_index);
6501 __tmp.put_u8(self.standard_mode as u8);
6502 for val in &self.mode_name {
6503 __tmp.put_u8(*val);
6504 }
6505 if matches!(version, MavlinkVersion::V2) {
6506 let len = __tmp.len();
6507 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6508 } else {
6509 __tmp.len()
6510 }
6511 }
6512}
6513#[doc = "A change to the sequence number indicates that the set of AVAILABLE_MODES has changed. A receiver must re-request all available modes whenever the sequence number changes. This is only emitted after the first change and should then be broadcast at low rate (nominally 0.3 Hz) and on change. See <https://mavlink.io/en/services/standard_modes.html>."]
6514#[doc = ""]
6515#[doc = "ID: 437"]
6516#[derive(Debug, Clone, PartialEq)]
6517#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6518#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6519#[cfg_attr(feature = "ts", derive(TS))]
6520#[cfg_attr(feature = "ts", ts(export))]
6521pub struct AVAILABLE_MODES_MONITOR_DATA {
6522 #[doc = "Sequence number. The value iterates sequentially whenever AVAILABLE_MODES changes (e.g. support for a new mode is added/removed dynamically)."]
6523 pub seq: u8,
6524}
6525impl AVAILABLE_MODES_MONITOR_DATA {
6526 pub const ENCODED_LEN: usize = 1usize;
6527 pub const DEFAULT: Self = Self { seq: 0_u8 };
6528 #[cfg(feature = "arbitrary")]
6529 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6530 use arbitrary::{Arbitrary, Unstructured};
6531 let mut buf = [0u8; 1024];
6532 rng.fill_bytes(&mut buf);
6533 let mut unstructured = Unstructured::new(&buf);
6534 Self::arbitrary(&mut unstructured).unwrap_or_default()
6535 }
6536}
6537impl Default for AVAILABLE_MODES_MONITOR_DATA {
6538 fn default() -> Self {
6539 Self::DEFAULT.clone()
6540 }
6541}
6542impl MessageData for AVAILABLE_MODES_MONITOR_DATA {
6543 type Message = MavMessage;
6544 const ID: u32 = 437u32;
6545 const NAME: &'static str = "AVAILABLE_MODES_MONITOR";
6546 const EXTRA_CRC: u8 = 30u8;
6547 const ENCODED_LEN: usize = 1usize;
6548 fn deser(
6549 _version: MavlinkVersion,
6550 __input: &[u8],
6551 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6552 let avail_len = __input.len();
6553 let mut payload_buf = [0; Self::ENCODED_LEN];
6554 let mut buf = if avail_len < Self::ENCODED_LEN {
6555 payload_buf[0..avail_len].copy_from_slice(__input);
6556 Bytes::new(&payload_buf)
6557 } else {
6558 Bytes::new(__input)
6559 };
6560 let mut __struct = Self::default();
6561 __struct.seq = buf.get_u8();
6562 Ok(__struct)
6563 }
6564 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6565 let mut __tmp = BytesMut::new(bytes);
6566 #[allow(clippy::absurd_extreme_comparisons)]
6567 #[allow(unused_comparisons)]
6568 if __tmp.remaining() < Self::ENCODED_LEN {
6569 panic!(
6570 "buffer is too small (need {} bytes, but got {})",
6571 Self::ENCODED_LEN,
6572 __tmp.remaining(),
6573 )
6574 }
6575 __tmp.put_u8(self.seq);
6576 if matches!(version, MavlinkVersion::V2) {
6577 let len = __tmp.len();
6578 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6579 } else {
6580 __tmp.len()
6581 }
6582 }
6583}
6584#[doc = "Drone IMU data. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
6585#[doc = ""]
6586#[doc = "ID: 60052"]
6587#[derive(Debug, Clone, PartialEq)]
6588#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6589#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6590#[cfg_attr(feature = "ts", derive(TS))]
6591#[cfg_attr(feature = "ts", ts(export))]
6592pub struct AVSS_DRONE_IMU_DATA {
6593 #[doc = "Timestamp (time since FC boot)."]
6594 pub time_boot_ms: u32,
6595 #[doc = "Quaternion component 1, w (1 in null-rotation)"]
6596 pub q1: f32,
6597 #[doc = "Quaternion component 2, x (0 in null-rotation)"]
6598 pub q2: f32,
6599 #[doc = "Quaternion component 3, y (0 in null-rotation)"]
6600 pub q3: f32,
6601 #[doc = "Quaternion component 4, z (0 in null-rotation)"]
6602 pub q4: f32,
6603 #[doc = "X acceleration"]
6604 pub xacc: f32,
6605 #[doc = "Y acceleration"]
6606 pub yacc: f32,
6607 #[doc = "Z acceleration"]
6608 pub zacc: f32,
6609 #[doc = "Angular speed around X axis"]
6610 pub xgyro: f32,
6611 #[doc = "Angular speed around Y axis"]
6612 pub ygyro: f32,
6613 #[doc = "Angular speed around Z axis"]
6614 pub zgyro: f32,
6615}
6616impl AVSS_DRONE_IMU_DATA {
6617 pub const ENCODED_LEN: usize = 44usize;
6618 pub const DEFAULT: Self = Self {
6619 time_boot_ms: 0_u32,
6620 q1: 0.0_f32,
6621 q2: 0.0_f32,
6622 q3: 0.0_f32,
6623 q4: 0.0_f32,
6624 xacc: 0.0_f32,
6625 yacc: 0.0_f32,
6626 zacc: 0.0_f32,
6627 xgyro: 0.0_f32,
6628 ygyro: 0.0_f32,
6629 zgyro: 0.0_f32,
6630 };
6631 #[cfg(feature = "arbitrary")]
6632 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6633 use arbitrary::{Arbitrary, Unstructured};
6634 let mut buf = [0u8; 1024];
6635 rng.fill_bytes(&mut buf);
6636 let mut unstructured = Unstructured::new(&buf);
6637 Self::arbitrary(&mut unstructured).unwrap_or_default()
6638 }
6639}
6640impl Default for AVSS_DRONE_IMU_DATA {
6641 fn default() -> Self {
6642 Self::DEFAULT.clone()
6643 }
6644}
6645impl MessageData for AVSS_DRONE_IMU_DATA {
6646 type Message = MavMessage;
6647 const ID: u32 = 60052u32;
6648 const NAME: &'static str = "AVSS_DRONE_IMU";
6649 const EXTRA_CRC: u8 = 101u8;
6650 const ENCODED_LEN: usize = 44usize;
6651 fn deser(
6652 _version: MavlinkVersion,
6653 __input: &[u8],
6654 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6655 let avail_len = __input.len();
6656 let mut payload_buf = [0; Self::ENCODED_LEN];
6657 let mut buf = if avail_len < Self::ENCODED_LEN {
6658 payload_buf[0..avail_len].copy_from_slice(__input);
6659 Bytes::new(&payload_buf)
6660 } else {
6661 Bytes::new(__input)
6662 };
6663 let mut __struct = Self::default();
6664 __struct.time_boot_ms = buf.get_u32_le();
6665 __struct.q1 = buf.get_f32_le();
6666 __struct.q2 = buf.get_f32_le();
6667 __struct.q3 = buf.get_f32_le();
6668 __struct.q4 = buf.get_f32_le();
6669 __struct.xacc = buf.get_f32_le();
6670 __struct.yacc = buf.get_f32_le();
6671 __struct.zacc = buf.get_f32_le();
6672 __struct.xgyro = buf.get_f32_le();
6673 __struct.ygyro = buf.get_f32_le();
6674 __struct.zgyro = buf.get_f32_le();
6675 Ok(__struct)
6676 }
6677 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6678 let mut __tmp = BytesMut::new(bytes);
6679 #[allow(clippy::absurd_extreme_comparisons)]
6680 #[allow(unused_comparisons)]
6681 if __tmp.remaining() < Self::ENCODED_LEN {
6682 panic!(
6683 "buffer is too small (need {} bytes, but got {})",
6684 Self::ENCODED_LEN,
6685 __tmp.remaining(),
6686 )
6687 }
6688 __tmp.put_u32_le(self.time_boot_ms);
6689 __tmp.put_f32_le(self.q1);
6690 __tmp.put_f32_le(self.q2);
6691 __tmp.put_f32_le(self.q3);
6692 __tmp.put_f32_le(self.q4);
6693 __tmp.put_f32_le(self.xacc);
6694 __tmp.put_f32_le(self.yacc);
6695 __tmp.put_f32_le(self.zacc);
6696 __tmp.put_f32_le(self.xgyro);
6697 __tmp.put_f32_le(self.ygyro);
6698 __tmp.put_f32_le(self.zgyro);
6699 if matches!(version, MavlinkVersion::V2) {
6700 let len = __tmp.len();
6701 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6702 } else {
6703 __tmp.len()
6704 }
6705 }
6706}
6707#[doc = "Drone operation mode."]
6708#[doc = ""]
6709#[doc = "ID: 60053"]
6710#[derive(Debug, Clone, PartialEq)]
6711#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6712#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6713#[cfg_attr(feature = "ts", derive(TS))]
6714#[cfg_attr(feature = "ts", ts(export))]
6715pub struct AVSS_DRONE_OPERATION_MODE_DATA {
6716 #[doc = "Timestamp (time since FC boot)."]
6717 pub time_boot_ms: u32,
6718 #[doc = "DJI M300 operation mode"]
6719 pub M300_operation_mode: u8,
6720 #[doc = "horsefly operation mode"]
6721 pub horsefly_operation_mode: u8,
6722}
6723impl AVSS_DRONE_OPERATION_MODE_DATA {
6724 pub const ENCODED_LEN: usize = 6usize;
6725 pub const DEFAULT: Self = Self {
6726 time_boot_ms: 0_u32,
6727 M300_operation_mode: 0_u8,
6728 horsefly_operation_mode: 0_u8,
6729 };
6730 #[cfg(feature = "arbitrary")]
6731 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6732 use arbitrary::{Arbitrary, Unstructured};
6733 let mut buf = [0u8; 1024];
6734 rng.fill_bytes(&mut buf);
6735 let mut unstructured = Unstructured::new(&buf);
6736 Self::arbitrary(&mut unstructured).unwrap_or_default()
6737 }
6738}
6739impl Default for AVSS_DRONE_OPERATION_MODE_DATA {
6740 fn default() -> Self {
6741 Self::DEFAULT.clone()
6742 }
6743}
6744impl MessageData for AVSS_DRONE_OPERATION_MODE_DATA {
6745 type Message = MavMessage;
6746 const ID: u32 = 60053u32;
6747 const NAME: &'static str = "AVSS_DRONE_OPERATION_MODE";
6748 const EXTRA_CRC: u8 = 45u8;
6749 const ENCODED_LEN: usize = 6usize;
6750 fn deser(
6751 _version: MavlinkVersion,
6752 __input: &[u8],
6753 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6754 let avail_len = __input.len();
6755 let mut payload_buf = [0; Self::ENCODED_LEN];
6756 let mut buf = if avail_len < Self::ENCODED_LEN {
6757 payload_buf[0..avail_len].copy_from_slice(__input);
6758 Bytes::new(&payload_buf)
6759 } else {
6760 Bytes::new(__input)
6761 };
6762 let mut __struct = Self::default();
6763 __struct.time_boot_ms = buf.get_u32_le();
6764 __struct.M300_operation_mode = buf.get_u8();
6765 __struct.horsefly_operation_mode = buf.get_u8();
6766 Ok(__struct)
6767 }
6768 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6769 let mut __tmp = BytesMut::new(bytes);
6770 #[allow(clippy::absurd_extreme_comparisons)]
6771 #[allow(unused_comparisons)]
6772 if __tmp.remaining() < Self::ENCODED_LEN {
6773 panic!(
6774 "buffer is too small (need {} bytes, but got {})",
6775 Self::ENCODED_LEN,
6776 __tmp.remaining(),
6777 )
6778 }
6779 __tmp.put_u32_le(self.time_boot_ms);
6780 __tmp.put_u8(self.M300_operation_mode);
6781 __tmp.put_u8(self.horsefly_operation_mode);
6782 if matches!(version, MavlinkVersion::V2) {
6783 let len = __tmp.len();
6784 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6785 } else {
6786 __tmp.len()
6787 }
6788 }
6789}
6790#[doc = "Drone position."]
6791#[doc = ""]
6792#[doc = "ID: 60051"]
6793#[derive(Debug, Clone, PartialEq)]
6794#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6795#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6796#[cfg_attr(feature = "ts", derive(TS))]
6797#[cfg_attr(feature = "ts", ts(export))]
6798pub struct AVSS_DRONE_POSITION_DATA {
6799 #[doc = "Timestamp (time since FC boot)."]
6800 pub time_boot_ms: u32,
6801 #[doc = "Latitude, expressed"]
6802 pub lat: i32,
6803 #[doc = "Longitude, expressed"]
6804 pub lon: i32,
6805 #[doc = "Altitude (MSL). Note that virtually all GPS modules provide both WGS84 and MSL."]
6806 pub alt: i32,
6807 #[doc = "Altitude above ground, This altitude is measured by a ultrasound, Laser rangefinder or millimeter-wave radar"]
6808 pub ground_alt: f32,
6809 #[doc = "This altitude is measured by a barometer"]
6810 pub barometer_alt: f32,
6811}
6812impl AVSS_DRONE_POSITION_DATA {
6813 pub const ENCODED_LEN: usize = 24usize;
6814 pub const DEFAULT: Self = Self {
6815 time_boot_ms: 0_u32,
6816 lat: 0_i32,
6817 lon: 0_i32,
6818 alt: 0_i32,
6819 ground_alt: 0.0_f32,
6820 barometer_alt: 0.0_f32,
6821 };
6822 #[cfg(feature = "arbitrary")]
6823 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6824 use arbitrary::{Arbitrary, Unstructured};
6825 let mut buf = [0u8; 1024];
6826 rng.fill_bytes(&mut buf);
6827 let mut unstructured = Unstructured::new(&buf);
6828 Self::arbitrary(&mut unstructured).unwrap_or_default()
6829 }
6830}
6831impl Default for AVSS_DRONE_POSITION_DATA {
6832 fn default() -> Self {
6833 Self::DEFAULT.clone()
6834 }
6835}
6836impl MessageData for AVSS_DRONE_POSITION_DATA {
6837 type Message = MavMessage;
6838 const ID: u32 = 60051u32;
6839 const NAME: &'static str = "AVSS_DRONE_POSITION";
6840 const EXTRA_CRC: u8 = 245u8;
6841 const ENCODED_LEN: usize = 24usize;
6842 fn deser(
6843 _version: MavlinkVersion,
6844 __input: &[u8],
6845 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6846 let avail_len = __input.len();
6847 let mut payload_buf = [0; Self::ENCODED_LEN];
6848 let mut buf = if avail_len < Self::ENCODED_LEN {
6849 payload_buf[0..avail_len].copy_from_slice(__input);
6850 Bytes::new(&payload_buf)
6851 } else {
6852 Bytes::new(__input)
6853 };
6854 let mut __struct = Self::default();
6855 __struct.time_boot_ms = buf.get_u32_le();
6856 __struct.lat = buf.get_i32_le();
6857 __struct.lon = buf.get_i32_le();
6858 __struct.alt = buf.get_i32_le();
6859 __struct.ground_alt = buf.get_f32_le();
6860 __struct.barometer_alt = buf.get_f32_le();
6861 Ok(__struct)
6862 }
6863 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6864 let mut __tmp = BytesMut::new(bytes);
6865 #[allow(clippy::absurd_extreme_comparisons)]
6866 #[allow(unused_comparisons)]
6867 if __tmp.remaining() < Self::ENCODED_LEN {
6868 panic!(
6869 "buffer is too small (need {} bytes, but got {})",
6870 Self::ENCODED_LEN,
6871 __tmp.remaining(),
6872 )
6873 }
6874 __tmp.put_u32_le(self.time_boot_ms);
6875 __tmp.put_i32_le(self.lat);
6876 __tmp.put_i32_le(self.lon);
6877 __tmp.put_i32_le(self.alt);
6878 __tmp.put_f32_le(self.ground_alt);
6879 __tmp.put_f32_le(self.barometer_alt);
6880 if matches!(version, MavlinkVersion::V2) {
6881 let len = __tmp.len();
6882 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6883 } else {
6884 __tmp.len()
6885 }
6886 }
6887}
6888#[doc = "AVSS PRS system status."]
6889#[doc = ""]
6890#[doc = "ID: 60050"]
6891#[derive(Debug, Clone, PartialEq)]
6892#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6893#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6894#[cfg_attr(feature = "ts", derive(TS))]
6895#[cfg_attr(feature = "ts", ts(export))]
6896pub struct AVSS_PRS_SYS_STATUS_DATA {
6897 #[doc = "Timestamp (time since PRS boot)."]
6898 pub time_boot_ms: u32,
6899 #[doc = "PRS error statuses"]
6900 pub error_status: u32,
6901 #[doc = "Estimated battery run-time without a remote connection and PRS battery voltage"]
6902 pub battery_status: u32,
6903 #[doc = "PRS arm statuses"]
6904 pub arm_status: u8,
6905 #[doc = "PRS battery charge statuses"]
6906 pub charge_status: u8,
6907}
6908impl AVSS_PRS_SYS_STATUS_DATA {
6909 pub const ENCODED_LEN: usize = 14usize;
6910 pub const DEFAULT: Self = Self {
6911 time_boot_ms: 0_u32,
6912 error_status: 0_u32,
6913 battery_status: 0_u32,
6914 arm_status: 0_u8,
6915 charge_status: 0_u8,
6916 };
6917 #[cfg(feature = "arbitrary")]
6918 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6919 use arbitrary::{Arbitrary, Unstructured};
6920 let mut buf = [0u8; 1024];
6921 rng.fill_bytes(&mut buf);
6922 let mut unstructured = Unstructured::new(&buf);
6923 Self::arbitrary(&mut unstructured).unwrap_or_default()
6924 }
6925}
6926impl Default for AVSS_PRS_SYS_STATUS_DATA {
6927 fn default() -> Self {
6928 Self::DEFAULT.clone()
6929 }
6930}
6931impl MessageData for AVSS_PRS_SYS_STATUS_DATA {
6932 type Message = MavMessage;
6933 const ID: u32 = 60050u32;
6934 const NAME: &'static str = "AVSS_PRS_SYS_STATUS";
6935 const EXTRA_CRC: u8 = 220u8;
6936 const ENCODED_LEN: usize = 14usize;
6937 fn deser(
6938 _version: MavlinkVersion,
6939 __input: &[u8],
6940 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6941 let avail_len = __input.len();
6942 let mut payload_buf = [0; Self::ENCODED_LEN];
6943 let mut buf = if avail_len < Self::ENCODED_LEN {
6944 payload_buf[0..avail_len].copy_from_slice(__input);
6945 Bytes::new(&payload_buf)
6946 } else {
6947 Bytes::new(__input)
6948 };
6949 let mut __struct = Self::default();
6950 __struct.time_boot_ms = buf.get_u32_le();
6951 __struct.error_status = buf.get_u32_le();
6952 __struct.battery_status = buf.get_u32_le();
6953 __struct.arm_status = buf.get_u8();
6954 __struct.charge_status = buf.get_u8();
6955 Ok(__struct)
6956 }
6957 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6958 let mut __tmp = BytesMut::new(bytes);
6959 #[allow(clippy::absurd_extreme_comparisons)]
6960 #[allow(unused_comparisons)]
6961 if __tmp.remaining() < Self::ENCODED_LEN {
6962 panic!(
6963 "buffer is too small (need {} bytes, but got {})",
6964 Self::ENCODED_LEN,
6965 __tmp.remaining(),
6966 )
6967 }
6968 __tmp.put_u32_le(self.time_boot_ms);
6969 __tmp.put_u32_le(self.error_status);
6970 __tmp.put_u32_le(self.battery_status);
6971 __tmp.put_u8(self.arm_status);
6972 __tmp.put_u8(self.charge_status);
6973 if matches!(version, MavlinkVersion::V2) {
6974 let len = __tmp.len();
6975 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6976 } else {
6977 __tmp.len()
6978 }
6979 }
6980}
6981#[doc = "Battery information that is static, or requires infrequent update. This message should requested using MAV_CMD_REQUEST_MESSAGE and/or streamed at very low rate. BATTERY_STATUS_V2 is used for higher-rate battery status information."]
6982#[doc = ""]
6983#[doc = "ID: 372"]
6984#[derive(Debug, Clone, PartialEq)]
6985#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6986#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6987#[cfg_attr(feature = "ts", derive(TS))]
6988#[cfg_attr(feature = "ts", ts(export))]
6989pub struct BATTERY_INFO_DATA {
6990 #[doc = "Minimum per-cell voltage when discharging. 0: field not provided."]
6991 pub discharge_minimum_voltage: f32,
6992 #[doc = "Minimum per-cell voltage when charging. 0: field not provided."]
6993 pub charging_minimum_voltage: f32,
6994 #[doc = "Minimum per-cell voltage when resting. 0: field not provided."]
6995 pub resting_minimum_voltage: f32,
6996 #[doc = "Maximum per-cell voltage when charged. 0: field not provided."]
6997 pub charging_maximum_voltage: f32,
6998 #[doc = "Maximum pack continuous charge current. 0: field not provided."]
6999 pub charging_maximum_current: f32,
7000 #[doc = "Battery nominal voltage. Used for conversion between Wh and Ah. 0: field not provided."]
7001 pub nominal_voltage: f32,
7002 #[doc = "Maximum pack discharge current. 0: field not provided."]
7003 pub discharge_maximum_current: f32,
7004 #[doc = "Maximum pack discharge burst current. 0: field not provided."]
7005 pub discharge_maximum_burst_current: f32,
7006 #[doc = "Fully charged design capacity. 0: field not provided."]
7007 pub design_capacity: f32,
7008 #[doc = "Predicted battery capacity when fully charged (accounting for battery degradation). NAN: field not provided."]
7009 pub full_charge_capacity: f32,
7010 #[doc = "Lifetime count of the number of charge/discharge cycles (<https://en.wikipedia.org/wiki/Charge_cycle>). UINT16_MAX: field not provided."]
7011 pub cycle_count: u16,
7012 #[doc = "Battery weight. 0: field not provided."]
7013 pub weight: u16,
7014 #[doc = "Battery ID"]
7015 pub id: u8,
7016 #[doc = "Function of the battery."]
7017 pub battery_function: MavBatteryFunction,
7018 #[doc = "Type (chemistry) of the battery."]
7019 pub mavtype: MavBatteryType,
7020 #[doc = "State of Health (SOH) estimate. Typically 100% at the time of manufacture and will decrease over time and use. -1: field not provided."]
7021 pub state_of_health: u8,
7022 #[doc = "Number of battery cells in series. 0: field not provided."]
7023 pub cells_in_series: u8,
7024 #[doc = "Manufacture date (DDMMYYYY) in ASCII characters, 0 terminated. All 0: field not provided."]
7025 #[cfg_attr(
7026 feature = "serde",
7027 serde(
7028 serialize_with = "crate::nulstr::serialize::<_, 9>",
7029 deserialize_with = "crate::nulstr::deserialize::<_, 9>"
7030 )
7031 )]
7032 #[cfg_attr(feature = "ts", ts(type = "string"))]
7033 pub manufacture_date: [u8; 9],
7034 #[doc = "Serial number in ASCII characters, 0 terminated. All 0: field not provided."]
7035 #[cfg_attr(
7036 feature = "serde",
7037 serde(
7038 serialize_with = "crate::nulstr::serialize::<_, 32>",
7039 deserialize_with = "crate::nulstr::deserialize::<_, 32>"
7040 )
7041 )]
7042 #[cfg_attr(feature = "ts", ts(type = "string"))]
7043 pub serial_number: [u8; 32],
7044 #[doc = "Battery device name. Formatted as manufacturer name then product name, separated with an underscore (in ASCII characters), 0 terminated. All 0: field not provided."]
7045 #[cfg_attr(
7046 feature = "serde",
7047 serde(
7048 serialize_with = "crate::nulstr::serialize::<_, 50>",
7049 deserialize_with = "crate::nulstr::deserialize::<_, 50>"
7050 )
7051 )]
7052 #[cfg_attr(feature = "ts", ts(type = "string"))]
7053 pub name: [u8; 50],
7054}
7055impl BATTERY_INFO_DATA {
7056 pub const ENCODED_LEN: usize = 140usize;
7057 pub const DEFAULT: Self = Self {
7058 discharge_minimum_voltage: 0.0_f32,
7059 charging_minimum_voltage: 0.0_f32,
7060 resting_minimum_voltage: 0.0_f32,
7061 charging_maximum_voltage: 0.0_f32,
7062 charging_maximum_current: 0.0_f32,
7063 nominal_voltage: 0.0_f32,
7064 discharge_maximum_current: 0.0_f32,
7065 discharge_maximum_burst_current: 0.0_f32,
7066 design_capacity: 0.0_f32,
7067 full_charge_capacity: 0.0_f32,
7068 cycle_count: 0_u16,
7069 weight: 0_u16,
7070 id: 0_u8,
7071 battery_function: MavBatteryFunction::DEFAULT,
7072 mavtype: MavBatteryType::DEFAULT,
7073 state_of_health: 0_u8,
7074 cells_in_series: 0_u8,
7075 manufacture_date: [0_u8; 9usize],
7076 serial_number: [0_u8; 32usize],
7077 name: [0_u8; 50usize],
7078 };
7079 #[cfg(feature = "arbitrary")]
7080 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7081 use arbitrary::{Arbitrary, Unstructured};
7082 let mut buf = [0u8; 1024];
7083 rng.fill_bytes(&mut buf);
7084 let mut unstructured = Unstructured::new(&buf);
7085 Self::arbitrary(&mut unstructured).unwrap_or_default()
7086 }
7087}
7088impl Default for BATTERY_INFO_DATA {
7089 fn default() -> Self {
7090 Self::DEFAULT.clone()
7091 }
7092}
7093impl MessageData for BATTERY_INFO_DATA {
7094 type Message = MavMessage;
7095 const ID: u32 = 372u32;
7096 const NAME: &'static str = "BATTERY_INFO";
7097 const EXTRA_CRC: u8 = 26u8;
7098 const ENCODED_LEN: usize = 140usize;
7099 fn deser(
7100 _version: MavlinkVersion,
7101 __input: &[u8],
7102 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7103 let avail_len = __input.len();
7104 let mut payload_buf = [0; Self::ENCODED_LEN];
7105 let mut buf = if avail_len < Self::ENCODED_LEN {
7106 payload_buf[0..avail_len].copy_from_slice(__input);
7107 Bytes::new(&payload_buf)
7108 } else {
7109 Bytes::new(__input)
7110 };
7111 let mut __struct = Self::default();
7112 __struct.discharge_minimum_voltage = buf.get_f32_le();
7113 __struct.charging_minimum_voltage = buf.get_f32_le();
7114 __struct.resting_minimum_voltage = buf.get_f32_le();
7115 __struct.charging_maximum_voltage = buf.get_f32_le();
7116 __struct.charging_maximum_current = buf.get_f32_le();
7117 __struct.nominal_voltage = buf.get_f32_le();
7118 __struct.discharge_maximum_current = buf.get_f32_le();
7119 __struct.discharge_maximum_burst_current = buf.get_f32_le();
7120 __struct.design_capacity = buf.get_f32_le();
7121 __struct.full_charge_capacity = buf.get_f32_le();
7122 __struct.cycle_count = buf.get_u16_le();
7123 __struct.weight = buf.get_u16_le();
7124 __struct.id = buf.get_u8();
7125 let tmp = buf.get_u8();
7126 __struct.battery_function =
7127 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7128 enum_type: "MavBatteryFunction",
7129 value: tmp as u32,
7130 })?;
7131 let tmp = buf.get_u8();
7132 __struct.mavtype =
7133 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7134 enum_type: "MavBatteryType",
7135 value: tmp as u32,
7136 })?;
7137 __struct.state_of_health = buf.get_u8();
7138 __struct.cells_in_series = buf.get_u8();
7139 for v in &mut __struct.manufacture_date {
7140 let val = buf.get_u8();
7141 *v = val;
7142 }
7143 for v in &mut __struct.serial_number {
7144 let val = buf.get_u8();
7145 *v = val;
7146 }
7147 for v in &mut __struct.name {
7148 let val = buf.get_u8();
7149 *v = val;
7150 }
7151 Ok(__struct)
7152 }
7153 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7154 let mut __tmp = BytesMut::new(bytes);
7155 #[allow(clippy::absurd_extreme_comparisons)]
7156 #[allow(unused_comparisons)]
7157 if __tmp.remaining() < Self::ENCODED_LEN {
7158 panic!(
7159 "buffer is too small (need {} bytes, but got {})",
7160 Self::ENCODED_LEN,
7161 __tmp.remaining(),
7162 )
7163 }
7164 __tmp.put_f32_le(self.discharge_minimum_voltage);
7165 __tmp.put_f32_le(self.charging_minimum_voltage);
7166 __tmp.put_f32_le(self.resting_minimum_voltage);
7167 __tmp.put_f32_le(self.charging_maximum_voltage);
7168 __tmp.put_f32_le(self.charging_maximum_current);
7169 __tmp.put_f32_le(self.nominal_voltage);
7170 __tmp.put_f32_le(self.discharge_maximum_current);
7171 __tmp.put_f32_le(self.discharge_maximum_burst_current);
7172 __tmp.put_f32_le(self.design_capacity);
7173 __tmp.put_f32_le(self.full_charge_capacity);
7174 __tmp.put_u16_le(self.cycle_count);
7175 __tmp.put_u16_le(self.weight);
7176 __tmp.put_u8(self.id);
7177 __tmp.put_u8(self.battery_function as u8);
7178 __tmp.put_u8(self.mavtype as u8);
7179 __tmp.put_u8(self.state_of_health);
7180 __tmp.put_u8(self.cells_in_series);
7181 for val in &self.manufacture_date {
7182 __tmp.put_u8(*val);
7183 }
7184 for val in &self.serial_number {
7185 __tmp.put_u8(*val);
7186 }
7187 for val in &self.name {
7188 __tmp.put_u8(*val);
7189 }
7190 if matches!(version, MavlinkVersion::V2) {
7191 let len = __tmp.len();
7192 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7193 } else {
7194 __tmp.len()
7195 }
7196 }
7197}
7198#[doc = "Battery information. Updates GCS with flight controller battery status. Smart batteries also use this message, but may additionally send BATTERY_INFO."]
7199#[doc = ""]
7200#[doc = "ID: 147"]
7201#[derive(Debug, Clone, PartialEq)]
7202#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7203#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7204#[cfg_attr(feature = "ts", derive(TS))]
7205#[cfg_attr(feature = "ts", ts(export))]
7206pub struct BATTERY_STATUS_DATA {
7207 #[doc = "Consumed charge, -1: autopilot does not provide consumption estimate"]
7208 pub current_consumed: i32,
7209 #[doc = "Consumed energy, -1: autopilot does not provide energy consumption estimate"]
7210 pub energy_consumed: i32,
7211 #[doc = "Temperature of the battery. INT16_MAX for unknown temperature."]
7212 pub temperature: i16,
7213 #[doc = "Battery voltage of cells 1 to 10 (see voltages_ext for cells 11-14). Cells in this field above the valid cell count for this battery should have the UINT16_MAX value. If individual cell voltages are unknown or not measured for this battery, then the overall battery voltage should be filled in cell 0, with all others set to UINT16_MAX. If the voltage of the battery is greater than (UINT16_MAX - 1), then cell 0 should be set to (UINT16_MAX - 1), and cell 1 to the remaining voltage. This can be extended to multiple cells if the total voltage is greater than 2 * (UINT16_MAX - 1)."]
7214 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7215 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7216 pub voltages: [u16; 10],
7217 #[doc = "Battery current, -1: autopilot does not measure the current"]
7218 pub current_battery: i16,
7219 #[doc = "Battery ID"]
7220 pub id: u8,
7221 #[doc = "Function of the battery"]
7222 pub battery_function: MavBatteryFunction,
7223 #[doc = "Type (chemistry) of the battery"]
7224 pub mavtype: MavBatteryType,
7225 #[doc = "Remaining battery energy. Values: [0-100], -1: autopilot does not estimate the remaining battery."]
7226 pub battery_remaining: i8,
7227 #[doc = "Remaining battery time, 0: autopilot does not provide remaining battery time estimate"]
7228 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7229 pub time_remaining: i32,
7230 #[doc = "State for extent of discharge, provided by autopilot for warning or external reactions"]
7231 #[cfg_attr(feature = "serde", serde(default))]
7232 pub charge_state: MavBatteryChargeState,
7233 #[doc = "Battery voltages for cells 11 to 14. Cells above the valid cell count for this battery should have a value of 0, where zero indicates not supported (note, this is different than for the voltages field and allows empty byte truncation). If the measured value is 0 then 1 should be sent instead."]
7234 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7235 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7236 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7237 pub voltages_ext: [u16; 4],
7238 #[doc = "Battery mode. Default (0) is that battery mode reporting is not supported or battery is in normal-use mode."]
7239 #[cfg_attr(feature = "serde", serde(default))]
7240 pub mode: MavBatteryMode,
7241 #[doc = "Fault/health indications. These should be set when charge_state is MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY (if not, fault reporting is not supported)."]
7242 #[cfg_attr(feature = "serde", serde(default))]
7243 pub fault_bitmask: MavBatteryFault,
7244}
7245impl BATTERY_STATUS_DATA {
7246 pub const ENCODED_LEN: usize = 54usize;
7247 pub const DEFAULT: Self = Self {
7248 current_consumed: 0_i32,
7249 energy_consumed: 0_i32,
7250 temperature: 0_i16,
7251 voltages: [0_u16; 10usize],
7252 current_battery: 0_i16,
7253 id: 0_u8,
7254 battery_function: MavBatteryFunction::DEFAULT,
7255 mavtype: MavBatteryType::DEFAULT,
7256 battery_remaining: 0_i8,
7257 time_remaining: 0_i32,
7258 charge_state: MavBatteryChargeState::DEFAULT,
7259 voltages_ext: [0_u16; 4usize],
7260 mode: MavBatteryMode::DEFAULT,
7261 fault_bitmask: MavBatteryFault::DEFAULT,
7262 };
7263 #[cfg(feature = "arbitrary")]
7264 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7265 use arbitrary::{Arbitrary, Unstructured};
7266 let mut buf = [0u8; 1024];
7267 rng.fill_bytes(&mut buf);
7268 let mut unstructured = Unstructured::new(&buf);
7269 Self::arbitrary(&mut unstructured).unwrap_or_default()
7270 }
7271}
7272impl Default for BATTERY_STATUS_DATA {
7273 fn default() -> Self {
7274 Self::DEFAULT.clone()
7275 }
7276}
7277impl MessageData for BATTERY_STATUS_DATA {
7278 type Message = MavMessage;
7279 const ID: u32 = 147u32;
7280 const NAME: &'static str = "BATTERY_STATUS";
7281 const EXTRA_CRC: u8 = 154u8;
7282 const ENCODED_LEN: usize = 54usize;
7283 fn deser(
7284 _version: MavlinkVersion,
7285 __input: &[u8],
7286 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7287 let avail_len = __input.len();
7288 let mut payload_buf = [0; Self::ENCODED_LEN];
7289 let mut buf = if avail_len < Self::ENCODED_LEN {
7290 payload_buf[0..avail_len].copy_from_slice(__input);
7291 Bytes::new(&payload_buf)
7292 } else {
7293 Bytes::new(__input)
7294 };
7295 let mut __struct = Self::default();
7296 __struct.current_consumed = buf.get_i32_le();
7297 __struct.energy_consumed = buf.get_i32_le();
7298 __struct.temperature = buf.get_i16_le();
7299 for v in &mut __struct.voltages {
7300 let val = buf.get_u16_le();
7301 *v = val;
7302 }
7303 __struct.current_battery = buf.get_i16_le();
7304 __struct.id = buf.get_u8();
7305 let tmp = buf.get_u8();
7306 __struct.battery_function =
7307 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7308 enum_type: "MavBatteryFunction",
7309 value: tmp as u32,
7310 })?;
7311 let tmp = buf.get_u8();
7312 __struct.mavtype =
7313 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7314 enum_type: "MavBatteryType",
7315 value: tmp as u32,
7316 })?;
7317 __struct.battery_remaining = buf.get_i8();
7318 __struct.time_remaining = buf.get_i32_le();
7319 let tmp = buf.get_u8();
7320 __struct.charge_state =
7321 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7322 enum_type: "MavBatteryChargeState",
7323 value: tmp as u32,
7324 })?;
7325 for v in &mut __struct.voltages_ext {
7326 let val = buf.get_u16_le();
7327 *v = val;
7328 }
7329 let tmp = buf.get_u8();
7330 __struct.mode =
7331 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7332 enum_type: "MavBatteryMode",
7333 value: tmp as u32,
7334 })?;
7335 let tmp = buf.get_u32_le();
7336 __struct.fault_bitmask = MavBatteryFault::from_bits(tmp & MavBatteryFault::all().bits())
7337 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
7338 flag_type: "MavBatteryFault",
7339 value: tmp as u32,
7340 })?;
7341 Ok(__struct)
7342 }
7343 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7344 let mut __tmp = BytesMut::new(bytes);
7345 #[allow(clippy::absurd_extreme_comparisons)]
7346 #[allow(unused_comparisons)]
7347 if __tmp.remaining() < Self::ENCODED_LEN {
7348 panic!(
7349 "buffer is too small (need {} bytes, but got {})",
7350 Self::ENCODED_LEN,
7351 __tmp.remaining(),
7352 )
7353 }
7354 __tmp.put_i32_le(self.current_consumed);
7355 __tmp.put_i32_le(self.energy_consumed);
7356 __tmp.put_i16_le(self.temperature);
7357 for val in &self.voltages {
7358 __tmp.put_u16_le(*val);
7359 }
7360 __tmp.put_i16_le(self.current_battery);
7361 __tmp.put_u8(self.id);
7362 __tmp.put_u8(self.battery_function as u8);
7363 __tmp.put_u8(self.mavtype as u8);
7364 __tmp.put_i8(self.battery_remaining);
7365 if matches!(version, MavlinkVersion::V2) {
7366 __tmp.put_i32_le(self.time_remaining);
7367 __tmp.put_u8(self.charge_state as u8);
7368 for val in &self.voltages_ext {
7369 __tmp.put_u16_le(*val);
7370 }
7371 __tmp.put_u8(self.mode as u8);
7372 __tmp.put_u32_le(self.fault_bitmask.bits());
7373 let len = __tmp.len();
7374 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7375 } else {
7376 __tmp.len()
7377 }
7378 }
7379}
7380#[doc = "Report button state change."]
7381#[doc = ""]
7382#[doc = "ID: 257"]
7383#[derive(Debug, Clone, PartialEq)]
7384#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7385#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7386#[cfg_attr(feature = "ts", derive(TS))]
7387#[cfg_attr(feature = "ts", ts(export))]
7388pub struct BUTTON_CHANGE_DATA {
7389 #[doc = "Timestamp (time since system boot)."]
7390 pub time_boot_ms: u32,
7391 #[doc = "Time of last change of button state."]
7392 pub last_change_ms: u32,
7393 #[doc = "Bitmap for state of buttons."]
7394 pub state: u8,
7395}
7396impl BUTTON_CHANGE_DATA {
7397 pub const ENCODED_LEN: usize = 9usize;
7398 pub const DEFAULT: Self = Self {
7399 time_boot_ms: 0_u32,
7400 last_change_ms: 0_u32,
7401 state: 0_u8,
7402 };
7403 #[cfg(feature = "arbitrary")]
7404 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7405 use arbitrary::{Arbitrary, Unstructured};
7406 let mut buf = [0u8; 1024];
7407 rng.fill_bytes(&mut buf);
7408 let mut unstructured = Unstructured::new(&buf);
7409 Self::arbitrary(&mut unstructured).unwrap_or_default()
7410 }
7411}
7412impl Default for BUTTON_CHANGE_DATA {
7413 fn default() -> Self {
7414 Self::DEFAULT.clone()
7415 }
7416}
7417impl MessageData for BUTTON_CHANGE_DATA {
7418 type Message = MavMessage;
7419 const ID: u32 = 257u32;
7420 const NAME: &'static str = "BUTTON_CHANGE";
7421 const EXTRA_CRC: u8 = 131u8;
7422 const ENCODED_LEN: usize = 9usize;
7423 fn deser(
7424 _version: MavlinkVersion,
7425 __input: &[u8],
7426 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7427 let avail_len = __input.len();
7428 let mut payload_buf = [0; Self::ENCODED_LEN];
7429 let mut buf = if avail_len < Self::ENCODED_LEN {
7430 payload_buf[0..avail_len].copy_from_slice(__input);
7431 Bytes::new(&payload_buf)
7432 } else {
7433 Bytes::new(__input)
7434 };
7435 let mut __struct = Self::default();
7436 __struct.time_boot_ms = buf.get_u32_le();
7437 __struct.last_change_ms = buf.get_u32_le();
7438 __struct.state = buf.get_u8();
7439 Ok(__struct)
7440 }
7441 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7442 let mut __tmp = BytesMut::new(bytes);
7443 #[allow(clippy::absurd_extreme_comparisons)]
7444 #[allow(unused_comparisons)]
7445 if __tmp.remaining() < Self::ENCODED_LEN {
7446 panic!(
7447 "buffer is too small (need {} bytes, but got {})",
7448 Self::ENCODED_LEN,
7449 __tmp.remaining(),
7450 )
7451 }
7452 __tmp.put_u32_le(self.time_boot_ms);
7453 __tmp.put_u32_le(self.last_change_ms);
7454 __tmp.put_u8(self.state);
7455 if matches!(version, MavlinkVersion::V2) {
7456 let len = __tmp.len();
7457 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7458 } else {
7459 __tmp.len()
7460 }
7461 }
7462}
7463#[doc = "Information about the status of a capture. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7464#[doc = ""]
7465#[doc = "ID: 262"]
7466#[derive(Debug, Clone, PartialEq)]
7467#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7468#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7469#[cfg_attr(feature = "ts", derive(TS))]
7470#[cfg_attr(feature = "ts", ts(export))]
7471pub struct CAMERA_CAPTURE_STATUS_DATA {
7472 #[doc = "Timestamp (time since system boot)."]
7473 pub time_boot_ms: u32,
7474 #[doc = "Image capture interval"]
7475 pub image_interval: f32,
7476 #[doc = "Elapsed time since recording started (0: Not supported/available). A GCS should compute recording time and use non-zero values of this field to correct any discrepancy."]
7477 pub recording_time_ms: u32,
7478 #[doc = "Available storage capacity."]
7479 pub available_capacity: f32,
7480 #[doc = "Current status of image capturing (0: idle, 1: capture in progress, 2: interval set but idle, 3: interval set and capture in progress)"]
7481 pub image_status: u8,
7482 #[doc = "Current status of video capturing (0: idle, 1: capture in progress)"]
7483 pub video_status: u8,
7484 #[doc = "Total number of images captured ('forever', or until reset using MAV_CMD_STORAGE_FORMAT)."]
7485 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7486 pub image_count: i32,
7487 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7488 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7489 pub camera_device_id: u8,
7490}
7491impl CAMERA_CAPTURE_STATUS_DATA {
7492 pub const ENCODED_LEN: usize = 23usize;
7493 pub const DEFAULT: Self = Self {
7494 time_boot_ms: 0_u32,
7495 image_interval: 0.0_f32,
7496 recording_time_ms: 0_u32,
7497 available_capacity: 0.0_f32,
7498 image_status: 0_u8,
7499 video_status: 0_u8,
7500 image_count: 0_i32,
7501 camera_device_id: 0_u8,
7502 };
7503 #[cfg(feature = "arbitrary")]
7504 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7505 use arbitrary::{Arbitrary, Unstructured};
7506 let mut buf = [0u8; 1024];
7507 rng.fill_bytes(&mut buf);
7508 let mut unstructured = Unstructured::new(&buf);
7509 Self::arbitrary(&mut unstructured).unwrap_or_default()
7510 }
7511}
7512impl Default for CAMERA_CAPTURE_STATUS_DATA {
7513 fn default() -> Self {
7514 Self::DEFAULT.clone()
7515 }
7516}
7517impl MessageData for CAMERA_CAPTURE_STATUS_DATA {
7518 type Message = MavMessage;
7519 const ID: u32 = 262u32;
7520 const NAME: &'static str = "CAMERA_CAPTURE_STATUS";
7521 const EXTRA_CRC: u8 = 12u8;
7522 const ENCODED_LEN: usize = 23usize;
7523 fn deser(
7524 _version: MavlinkVersion,
7525 __input: &[u8],
7526 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7527 let avail_len = __input.len();
7528 let mut payload_buf = [0; Self::ENCODED_LEN];
7529 let mut buf = if avail_len < Self::ENCODED_LEN {
7530 payload_buf[0..avail_len].copy_from_slice(__input);
7531 Bytes::new(&payload_buf)
7532 } else {
7533 Bytes::new(__input)
7534 };
7535 let mut __struct = Self::default();
7536 __struct.time_boot_ms = buf.get_u32_le();
7537 __struct.image_interval = buf.get_f32_le();
7538 __struct.recording_time_ms = buf.get_u32_le();
7539 __struct.available_capacity = buf.get_f32_le();
7540 __struct.image_status = buf.get_u8();
7541 __struct.video_status = buf.get_u8();
7542 __struct.image_count = buf.get_i32_le();
7543 __struct.camera_device_id = buf.get_u8();
7544 Ok(__struct)
7545 }
7546 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7547 let mut __tmp = BytesMut::new(bytes);
7548 #[allow(clippy::absurd_extreme_comparisons)]
7549 #[allow(unused_comparisons)]
7550 if __tmp.remaining() < Self::ENCODED_LEN {
7551 panic!(
7552 "buffer is too small (need {} bytes, but got {})",
7553 Self::ENCODED_LEN,
7554 __tmp.remaining(),
7555 )
7556 }
7557 __tmp.put_u32_le(self.time_boot_ms);
7558 __tmp.put_f32_le(self.image_interval);
7559 __tmp.put_u32_le(self.recording_time_ms);
7560 __tmp.put_f32_le(self.available_capacity);
7561 __tmp.put_u8(self.image_status);
7562 __tmp.put_u8(self.video_status);
7563 if matches!(version, MavlinkVersion::V2) {
7564 __tmp.put_i32_le(self.image_count);
7565 __tmp.put_u8(self.camera_device_id);
7566 let len = __tmp.len();
7567 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7568 } else {
7569 __tmp.len()
7570 }
7571 }
7572}
7573#[doc = "Information about the field of view of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7574#[doc = ""]
7575#[doc = "ID: 271"]
7576#[derive(Debug, Clone, PartialEq)]
7577#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7578#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7579#[cfg_attr(feature = "ts", derive(TS))]
7580#[cfg_attr(feature = "ts", ts(export))]
7581pub struct CAMERA_FOV_STATUS_DATA {
7582 #[doc = "Timestamp (time since system boot)."]
7583 pub time_boot_ms: u32,
7584 #[doc = "Latitude of camera (INT32_MAX if unknown)."]
7585 pub lat_camera: i32,
7586 #[doc = "Longitude of camera (INT32_MAX if unknown)."]
7587 pub lon_camera: i32,
7588 #[doc = "Altitude (MSL) of camera (INT32_MAX if unknown)."]
7589 pub alt_camera: i32,
7590 #[doc = "Latitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
7591 pub lat_image: i32,
7592 #[doc = "Longitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
7593 pub lon_image: i32,
7594 #[doc = "Altitude (MSL) of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
7595 pub alt_image: i32,
7596 #[doc = "Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
7597 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7598 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7599 pub q: [f32; 4],
7600 #[doc = "Horizontal field of view (NaN if unknown)."]
7601 pub hfov: f32,
7602 #[doc = "Vertical field of view (NaN if unknown)."]
7603 pub vfov: f32,
7604 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7605 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7606 pub camera_device_id: u8,
7607}
7608impl CAMERA_FOV_STATUS_DATA {
7609 pub const ENCODED_LEN: usize = 53usize;
7610 pub const DEFAULT: Self = Self {
7611 time_boot_ms: 0_u32,
7612 lat_camera: 0_i32,
7613 lon_camera: 0_i32,
7614 alt_camera: 0_i32,
7615 lat_image: 0_i32,
7616 lon_image: 0_i32,
7617 alt_image: 0_i32,
7618 q: [0.0_f32; 4usize],
7619 hfov: 0.0_f32,
7620 vfov: 0.0_f32,
7621 camera_device_id: 0_u8,
7622 };
7623 #[cfg(feature = "arbitrary")]
7624 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7625 use arbitrary::{Arbitrary, Unstructured};
7626 let mut buf = [0u8; 1024];
7627 rng.fill_bytes(&mut buf);
7628 let mut unstructured = Unstructured::new(&buf);
7629 Self::arbitrary(&mut unstructured).unwrap_or_default()
7630 }
7631}
7632impl Default for CAMERA_FOV_STATUS_DATA {
7633 fn default() -> Self {
7634 Self::DEFAULT.clone()
7635 }
7636}
7637impl MessageData for CAMERA_FOV_STATUS_DATA {
7638 type Message = MavMessage;
7639 const ID: u32 = 271u32;
7640 const NAME: &'static str = "CAMERA_FOV_STATUS";
7641 const EXTRA_CRC: u8 = 22u8;
7642 const ENCODED_LEN: usize = 53usize;
7643 fn deser(
7644 _version: MavlinkVersion,
7645 __input: &[u8],
7646 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7647 let avail_len = __input.len();
7648 let mut payload_buf = [0; Self::ENCODED_LEN];
7649 let mut buf = if avail_len < Self::ENCODED_LEN {
7650 payload_buf[0..avail_len].copy_from_slice(__input);
7651 Bytes::new(&payload_buf)
7652 } else {
7653 Bytes::new(__input)
7654 };
7655 let mut __struct = Self::default();
7656 __struct.time_boot_ms = buf.get_u32_le();
7657 __struct.lat_camera = buf.get_i32_le();
7658 __struct.lon_camera = buf.get_i32_le();
7659 __struct.alt_camera = buf.get_i32_le();
7660 __struct.lat_image = buf.get_i32_le();
7661 __struct.lon_image = buf.get_i32_le();
7662 __struct.alt_image = buf.get_i32_le();
7663 for v in &mut __struct.q {
7664 let val = buf.get_f32_le();
7665 *v = val;
7666 }
7667 __struct.hfov = buf.get_f32_le();
7668 __struct.vfov = buf.get_f32_le();
7669 __struct.camera_device_id = buf.get_u8();
7670 Ok(__struct)
7671 }
7672 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7673 let mut __tmp = BytesMut::new(bytes);
7674 #[allow(clippy::absurd_extreme_comparisons)]
7675 #[allow(unused_comparisons)]
7676 if __tmp.remaining() < Self::ENCODED_LEN {
7677 panic!(
7678 "buffer is too small (need {} bytes, but got {})",
7679 Self::ENCODED_LEN,
7680 __tmp.remaining(),
7681 )
7682 }
7683 __tmp.put_u32_le(self.time_boot_ms);
7684 __tmp.put_i32_le(self.lat_camera);
7685 __tmp.put_i32_le(self.lon_camera);
7686 __tmp.put_i32_le(self.alt_camera);
7687 __tmp.put_i32_le(self.lat_image);
7688 __tmp.put_i32_le(self.lon_image);
7689 __tmp.put_i32_le(self.alt_image);
7690 for val in &self.q {
7691 __tmp.put_f32_le(*val);
7692 }
7693 __tmp.put_f32_le(self.hfov);
7694 __tmp.put_f32_le(self.vfov);
7695 if matches!(version, MavlinkVersion::V2) {
7696 __tmp.put_u8(self.camera_device_id);
7697 let len = __tmp.len();
7698 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7699 } else {
7700 __tmp.len()
7701 }
7702 }
7703}
7704#[doc = "Information about a captured image. This is emitted every time a message is captured. MAV_CMD_REQUEST_MESSAGE can be used to (re)request this message for a specific sequence number or range of sequence numbers: MAV_CMD_REQUEST_MESSAGE.param2 indicates the sequence number the first image to send, or set to -1 to send the message for all sequence numbers. MAV_CMD_REQUEST_MESSAGE.param3 is used to specify a range of messages to send: set to 0 (default) to send just the the message for the sequence number in param 2, set to -1 to send the message for the sequence number in param 2 and all the following sequence numbers, set to the sequence number of the final message in the range."]
7705#[doc = ""]
7706#[doc = "ID: 263"]
7707#[derive(Debug, Clone, PartialEq)]
7708#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7709#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7710#[cfg_attr(feature = "ts", derive(TS))]
7711#[cfg_attr(feature = "ts", ts(export))]
7712pub struct CAMERA_IMAGE_CAPTURED_DATA {
7713 #[doc = "Timestamp (time since UNIX epoch) in UTC. 0 for unknown."]
7714 pub time_utc: u64,
7715 #[doc = "Timestamp (time since system boot)."]
7716 pub time_boot_ms: u32,
7717 #[doc = "Latitude where image was taken"]
7718 pub lat: i32,
7719 #[doc = "Longitude where capture was taken"]
7720 pub lon: i32,
7721 #[doc = "Altitude (MSL) where image was taken"]
7722 pub alt: i32,
7723 #[doc = "Altitude above ground"]
7724 pub relative_alt: i32,
7725 #[doc = "Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
7726 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7727 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7728 pub q: [f32; 4],
7729 #[doc = "Zero based index of this image (i.e. a new image will have index CAMERA_CAPTURE_STATUS.image count -1)"]
7730 pub image_index: i32,
7731 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id). Field name is usually camera_device_id."]
7732 pub camera_id: u8,
7733 #[doc = "Boolean indicating success (1) or failure (0) while capturing this image."]
7734 pub capture_result: i8,
7735 #[doc = "URL of image taken. Either local storage or <http://foo.jpg> if camera provides an HTTP interface."]
7736 #[cfg_attr(
7737 feature = "serde",
7738 serde(
7739 serialize_with = "crate::nulstr::serialize::<_, 205>",
7740 deserialize_with = "crate::nulstr::deserialize::<_, 205>"
7741 )
7742 )]
7743 #[cfg_attr(feature = "ts", ts(type = "string"))]
7744 pub file_url: [u8; 205],
7745}
7746impl CAMERA_IMAGE_CAPTURED_DATA {
7747 pub const ENCODED_LEN: usize = 255usize;
7748 pub const DEFAULT: Self = Self {
7749 time_utc: 0_u64,
7750 time_boot_ms: 0_u32,
7751 lat: 0_i32,
7752 lon: 0_i32,
7753 alt: 0_i32,
7754 relative_alt: 0_i32,
7755 q: [0.0_f32; 4usize],
7756 image_index: 0_i32,
7757 camera_id: 0_u8,
7758 capture_result: 0_i8,
7759 file_url: [0_u8; 205usize],
7760 };
7761 #[cfg(feature = "arbitrary")]
7762 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7763 use arbitrary::{Arbitrary, Unstructured};
7764 let mut buf = [0u8; 1024];
7765 rng.fill_bytes(&mut buf);
7766 let mut unstructured = Unstructured::new(&buf);
7767 Self::arbitrary(&mut unstructured).unwrap_or_default()
7768 }
7769}
7770impl Default for CAMERA_IMAGE_CAPTURED_DATA {
7771 fn default() -> Self {
7772 Self::DEFAULT.clone()
7773 }
7774}
7775impl MessageData for CAMERA_IMAGE_CAPTURED_DATA {
7776 type Message = MavMessage;
7777 const ID: u32 = 263u32;
7778 const NAME: &'static str = "CAMERA_IMAGE_CAPTURED";
7779 const EXTRA_CRC: u8 = 133u8;
7780 const ENCODED_LEN: usize = 255usize;
7781 fn deser(
7782 _version: MavlinkVersion,
7783 __input: &[u8],
7784 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7785 let avail_len = __input.len();
7786 let mut payload_buf = [0; Self::ENCODED_LEN];
7787 let mut buf = if avail_len < Self::ENCODED_LEN {
7788 payload_buf[0..avail_len].copy_from_slice(__input);
7789 Bytes::new(&payload_buf)
7790 } else {
7791 Bytes::new(__input)
7792 };
7793 let mut __struct = Self::default();
7794 __struct.time_utc = buf.get_u64_le();
7795 __struct.time_boot_ms = buf.get_u32_le();
7796 __struct.lat = buf.get_i32_le();
7797 __struct.lon = buf.get_i32_le();
7798 __struct.alt = buf.get_i32_le();
7799 __struct.relative_alt = buf.get_i32_le();
7800 for v in &mut __struct.q {
7801 let val = buf.get_f32_le();
7802 *v = val;
7803 }
7804 __struct.image_index = buf.get_i32_le();
7805 __struct.camera_id = buf.get_u8();
7806 __struct.capture_result = buf.get_i8();
7807 for v in &mut __struct.file_url {
7808 let val = buf.get_u8();
7809 *v = val;
7810 }
7811 Ok(__struct)
7812 }
7813 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7814 let mut __tmp = BytesMut::new(bytes);
7815 #[allow(clippy::absurd_extreme_comparisons)]
7816 #[allow(unused_comparisons)]
7817 if __tmp.remaining() < Self::ENCODED_LEN {
7818 panic!(
7819 "buffer is too small (need {} bytes, but got {})",
7820 Self::ENCODED_LEN,
7821 __tmp.remaining(),
7822 )
7823 }
7824 __tmp.put_u64_le(self.time_utc);
7825 __tmp.put_u32_le(self.time_boot_ms);
7826 __tmp.put_i32_le(self.lat);
7827 __tmp.put_i32_le(self.lon);
7828 __tmp.put_i32_le(self.alt);
7829 __tmp.put_i32_le(self.relative_alt);
7830 for val in &self.q {
7831 __tmp.put_f32_le(*val);
7832 }
7833 __tmp.put_i32_le(self.image_index);
7834 __tmp.put_u8(self.camera_id);
7835 __tmp.put_i8(self.capture_result);
7836 for val in &self.file_url {
7837 __tmp.put_u8(*val);
7838 }
7839 if matches!(version, MavlinkVersion::V2) {
7840 let len = __tmp.len();
7841 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7842 } else {
7843 __tmp.len()
7844 }
7845 }
7846}
7847#[doc = "Information about a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7848#[doc = ""]
7849#[doc = "ID: 259"]
7850#[derive(Debug, Clone, PartialEq)]
7851#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7852#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7853#[cfg_attr(feature = "ts", derive(TS))]
7854#[cfg_attr(feature = "ts", ts(export))]
7855pub struct CAMERA_INFORMATION_DATA {
7856 #[doc = "Timestamp (time since system boot)."]
7857 pub time_boot_ms: u32,
7858 #[doc = "0xff). Use 0 if not known."]
7859 pub firmware_version: u32,
7860 #[doc = "Focal length. Use NaN if not known."]
7861 pub focal_length: f32,
7862 #[doc = "Image sensor size horizontal. Use NaN if not known."]
7863 pub sensor_size_h: f32,
7864 #[doc = "Image sensor size vertical. Use NaN if not known."]
7865 pub sensor_size_v: f32,
7866 #[doc = "Bitmap of camera capability flags."]
7867 pub flags: CameraCapFlags,
7868 #[doc = "Horizontal image resolution. Use 0 if not known."]
7869 pub resolution_h: u16,
7870 #[doc = "Vertical image resolution. Use 0 if not known."]
7871 pub resolution_v: u16,
7872 #[doc = "Camera definition version (iteration). Use 0 if not known."]
7873 pub cam_definition_version: u16,
7874 #[doc = "Name of the camera vendor"]
7875 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7876 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7877 pub vendor_name: [u8; 32],
7878 #[doc = "Name of the camera model"]
7879 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7880 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7881 pub model_name: [u8; 32],
7882 #[doc = "Reserved for a lens ID. Use 0 if not known."]
7883 pub lens_id: u8,
7884 #[doc = "Camera definition URI (if any, otherwise only basic functions will be available). HTTP- (http://) and MAVLink FTP- (mavlinkftp://) formatted URIs are allowed (and both must be supported by any GCS that implements the Camera Protocol). The definition file may be xz compressed, which will be indicated by the file extension .xml.xz (a GCS that implements the protocol must support decompressing the file). The string needs to be zero terminated. Use a zero-length string if not known."]
7885 #[cfg_attr(
7886 feature = "serde",
7887 serde(
7888 serialize_with = "crate::nulstr::serialize::<_, 140>",
7889 deserialize_with = "crate::nulstr::deserialize::<_, 140>"
7890 )
7891 )]
7892 #[cfg_attr(feature = "ts", ts(type = "string"))]
7893 pub cam_definition_uri: [u8; 140],
7894 #[doc = "Gimbal id of a gimbal associated with this camera. This is the component id of the gimbal device, or 1-6 for non mavlink gimbals. Use 0 if no gimbal is associated with the camera."]
7895 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7896 pub gimbal_device_id: u8,
7897 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7898 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7899 pub camera_device_id: u8,
7900}
7901impl CAMERA_INFORMATION_DATA {
7902 pub const ENCODED_LEN: usize = 237usize;
7903 pub const DEFAULT: Self = Self {
7904 time_boot_ms: 0_u32,
7905 firmware_version: 0_u32,
7906 focal_length: 0.0_f32,
7907 sensor_size_h: 0.0_f32,
7908 sensor_size_v: 0.0_f32,
7909 flags: CameraCapFlags::DEFAULT,
7910 resolution_h: 0_u16,
7911 resolution_v: 0_u16,
7912 cam_definition_version: 0_u16,
7913 vendor_name: [0_u8; 32usize],
7914 model_name: [0_u8; 32usize],
7915 lens_id: 0_u8,
7916 cam_definition_uri: [0_u8; 140usize],
7917 gimbal_device_id: 0_u8,
7918 camera_device_id: 0_u8,
7919 };
7920 #[cfg(feature = "arbitrary")]
7921 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7922 use arbitrary::{Arbitrary, Unstructured};
7923 let mut buf = [0u8; 1024];
7924 rng.fill_bytes(&mut buf);
7925 let mut unstructured = Unstructured::new(&buf);
7926 Self::arbitrary(&mut unstructured).unwrap_or_default()
7927 }
7928}
7929impl Default for CAMERA_INFORMATION_DATA {
7930 fn default() -> Self {
7931 Self::DEFAULT.clone()
7932 }
7933}
7934impl MessageData for CAMERA_INFORMATION_DATA {
7935 type Message = MavMessage;
7936 const ID: u32 = 259u32;
7937 const NAME: &'static str = "CAMERA_INFORMATION";
7938 const EXTRA_CRC: u8 = 92u8;
7939 const ENCODED_LEN: usize = 237usize;
7940 fn deser(
7941 _version: MavlinkVersion,
7942 __input: &[u8],
7943 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7944 let avail_len = __input.len();
7945 let mut payload_buf = [0; Self::ENCODED_LEN];
7946 let mut buf = if avail_len < Self::ENCODED_LEN {
7947 payload_buf[0..avail_len].copy_from_slice(__input);
7948 Bytes::new(&payload_buf)
7949 } else {
7950 Bytes::new(__input)
7951 };
7952 let mut __struct = Self::default();
7953 __struct.time_boot_ms = buf.get_u32_le();
7954 __struct.firmware_version = buf.get_u32_le();
7955 __struct.focal_length = buf.get_f32_le();
7956 __struct.sensor_size_h = buf.get_f32_le();
7957 __struct.sensor_size_v = buf.get_f32_le();
7958 let tmp = buf.get_u32_le();
7959 __struct.flags = CameraCapFlags::from_bits(tmp & CameraCapFlags::all().bits()).ok_or(
7960 ::mavlink_core::error::ParserError::InvalidFlag {
7961 flag_type: "CameraCapFlags",
7962 value: tmp as u32,
7963 },
7964 )?;
7965 __struct.resolution_h = buf.get_u16_le();
7966 __struct.resolution_v = buf.get_u16_le();
7967 __struct.cam_definition_version = buf.get_u16_le();
7968 for v in &mut __struct.vendor_name {
7969 let val = buf.get_u8();
7970 *v = val;
7971 }
7972 for v in &mut __struct.model_name {
7973 let val = buf.get_u8();
7974 *v = val;
7975 }
7976 __struct.lens_id = buf.get_u8();
7977 for v in &mut __struct.cam_definition_uri {
7978 let val = buf.get_u8();
7979 *v = val;
7980 }
7981 __struct.gimbal_device_id = buf.get_u8();
7982 __struct.camera_device_id = buf.get_u8();
7983 Ok(__struct)
7984 }
7985 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7986 let mut __tmp = BytesMut::new(bytes);
7987 #[allow(clippy::absurd_extreme_comparisons)]
7988 #[allow(unused_comparisons)]
7989 if __tmp.remaining() < Self::ENCODED_LEN {
7990 panic!(
7991 "buffer is too small (need {} bytes, but got {})",
7992 Self::ENCODED_LEN,
7993 __tmp.remaining(),
7994 )
7995 }
7996 __tmp.put_u32_le(self.time_boot_ms);
7997 __tmp.put_u32_le(self.firmware_version);
7998 __tmp.put_f32_le(self.focal_length);
7999 __tmp.put_f32_le(self.sensor_size_h);
8000 __tmp.put_f32_le(self.sensor_size_v);
8001 __tmp.put_u32_le(self.flags.bits());
8002 __tmp.put_u16_le(self.resolution_h);
8003 __tmp.put_u16_le(self.resolution_v);
8004 __tmp.put_u16_le(self.cam_definition_version);
8005 for val in &self.vendor_name {
8006 __tmp.put_u8(*val);
8007 }
8008 for val in &self.model_name {
8009 __tmp.put_u8(*val);
8010 }
8011 __tmp.put_u8(self.lens_id);
8012 for val in &self.cam_definition_uri {
8013 __tmp.put_u8(*val);
8014 }
8015 if matches!(version, MavlinkVersion::V2) {
8016 __tmp.put_u8(self.gimbal_device_id);
8017 __tmp.put_u8(self.camera_device_id);
8018 let len = __tmp.len();
8019 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8020 } else {
8021 __tmp.len()
8022 }
8023 }
8024}
8025#[doc = "Settings of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
8026#[doc = ""]
8027#[doc = "ID: 260"]
8028#[derive(Debug, Clone, PartialEq)]
8029#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8030#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8031#[cfg_attr(feature = "ts", derive(TS))]
8032#[cfg_attr(feature = "ts", ts(export))]
8033pub struct CAMERA_SETTINGS_DATA {
8034 #[doc = "Timestamp (time since system boot)."]
8035 pub time_boot_ms: u32,
8036 #[doc = "Camera mode"]
8037 pub mode_id: CameraMode,
8038 #[doc = "Current zoom level as a percentage of the full range (0.0 to 100.0, NaN if not known)"]
8039 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8040 pub zoomLevel: f32,
8041 #[doc = "Current focus level as a percentage of the full range (0.0 to 100.0, NaN if not known)"]
8042 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8043 pub focusLevel: f32,
8044 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
8045 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8046 pub camera_device_id: u8,
8047}
8048impl CAMERA_SETTINGS_DATA {
8049 pub const ENCODED_LEN: usize = 14usize;
8050 pub const DEFAULT: Self = Self {
8051 time_boot_ms: 0_u32,
8052 mode_id: CameraMode::DEFAULT,
8053 zoomLevel: 0.0_f32,
8054 focusLevel: 0.0_f32,
8055 camera_device_id: 0_u8,
8056 };
8057 #[cfg(feature = "arbitrary")]
8058 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8059 use arbitrary::{Arbitrary, Unstructured};
8060 let mut buf = [0u8; 1024];
8061 rng.fill_bytes(&mut buf);
8062 let mut unstructured = Unstructured::new(&buf);
8063 Self::arbitrary(&mut unstructured).unwrap_or_default()
8064 }
8065}
8066impl Default for CAMERA_SETTINGS_DATA {
8067 fn default() -> Self {
8068 Self::DEFAULT.clone()
8069 }
8070}
8071impl MessageData for CAMERA_SETTINGS_DATA {
8072 type Message = MavMessage;
8073 const ID: u32 = 260u32;
8074 const NAME: &'static str = "CAMERA_SETTINGS";
8075 const EXTRA_CRC: u8 = 146u8;
8076 const ENCODED_LEN: usize = 14usize;
8077 fn deser(
8078 _version: MavlinkVersion,
8079 __input: &[u8],
8080 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8081 let avail_len = __input.len();
8082 let mut payload_buf = [0; Self::ENCODED_LEN];
8083 let mut buf = if avail_len < Self::ENCODED_LEN {
8084 payload_buf[0..avail_len].copy_from_slice(__input);
8085 Bytes::new(&payload_buf)
8086 } else {
8087 Bytes::new(__input)
8088 };
8089 let mut __struct = Self::default();
8090 __struct.time_boot_ms = buf.get_u32_le();
8091 let tmp = buf.get_u8();
8092 __struct.mode_id =
8093 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8094 enum_type: "CameraMode",
8095 value: tmp as u32,
8096 })?;
8097 __struct.zoomLevel = buf.get_f32_le();
8098 __struct.focusLevel = buf.get_f32_le();
8099 __struct.camera_device_id = buf.get_u8();
8100 Ok(__struct)
8101 }
8102 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8103 let mut __tmp = BytesMut::new(bytes);
8104 #[allow(clippy::absurd_extreme_comparisons)]
8105 #[allow(unused_comparisons)]
8106 if __tmp.remaining() < Self::ENCODED_LEN {
8107 panic!(
8108 "buffer is too small (need {} bytes, but got {})",
8109 Self::ENCODED_LEN,
8110 __tmp.remaining(),
8111 )
8112 }
8113 __tmp.put_u32_le(self.time_boot_ms);
8114 __tmp.put_u8(self.mode_id as u8);
8115 if matches!(version, MavlinkVersion::V2) {
8116 __tmp.put_f32_le(self.zoomLevel);
8117 __tmp.put_f32_le(self.focusLevel);
8118 __tmp.put_u8(self.camera_device_id);
8119 let len = __tmp.len();
8120 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8121 } else {
8122 __tmp.len()
8123 }
8124 }
8125}
8126#[doc = "Camera absolute thermal range. This can be streamed when the associated VIDEO_STREAM_STATUS `flag` field bit VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED is set, but a GCS may choose to only request it for the current active stream. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval (param3 indicates the stream id of the current camera, or 0 for all streams, param4 indicates the target camera_device_id for autopilot-attached cameras or 0 for MAVLink cameras)."]
8127#[doc = ""]
8128#[doc = "ID: 277"]
8129#[derive(Debug, Clone, PartialEq)]
8130#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8131#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8132#[cfg_attr(feature = "ts", derive(TS))]
8133#[cfg_attr(feature = "ts", ts(export))]
8134pub struct CAMERA_THERMAL_RANGE_DATA {
8135 #[doc = "Timestamp (time since system boot)."]
8136 pub time_boot_ms: u32,
8137 #[doc = "Temperature max."]
8138 pub max: f32,
8139 #[doc = "Temperature max point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown."]
8140 pub max_point_x: f32,
8141 #[doc = "Temperature max point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown."]
8142 pub max_point_y: f32,
8143 #[doc = "Temperature min."]
8144 pub min: f32,
8145 #[doc = "Temperature min point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown."]
8146 pub min_point_x: f32,
8147 #[doc = "Temperature min point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown."]
8148 pub min_point_y: f32,
8149 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
8150 pub stream_id: u8,
8151 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
8152 pub camera_device_id: u8,
8153}
8154impl CAMERA_THERMAL_RANGE_DATA {
8155 pub const ENCODED_LEN: usize = 30usize;
8156 pub const DEFAULT: Self = Self {
8157 time_boot_ms: 0_u32,
8158 max: 0.0_f32,
8159 max_point_x: 0.0_f32,
8160 max_point_y: 0.0_f32,
8161 min: 0.0_f32,
8162 min_point_x: 0.0_f32,
8163 min_point_y: 0.0_f32,
8164 stream_id: 0_u8,
8165 camera_device_id: 0_u8,
8166 };
8167 #[cfg(feature = "arbitrary")]
8168 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8169 use arbitrary::{Arbitrary, Unstructured};
8170 let mut buf = [0u8; 1024];
8171 rng.fill_bytes(&mut buf);
8172 let mut unstructured = Unstructured::new(&buf);
8173 Self::arbitrary(&mut unstructured).unwrap_or_default()
8174 }
8175}
8176impl Default for CAMERA_THERMAL_RANGE_DATA {
8177 fn default() -> Self {
8178 Self::DEFAULT.clone()
8179 }
8180}
8181impl MessageData for CAMERA_THERMAL_RANGE_DATA {
8182 type Message = MavMessage;
8183 const ID: u32 = 277u32;
8184 const NAME: &'static str = "CAMERA_THERMAL_RANGE";
8185 const EXTRA_CRC: u8 = 62u8;
8186 const ENCODED_LEN: usize = 30usize;
8187 fn deser(
8188 _version: MavlinkVersion,
8189 __input: &[u8],
8190 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8191 let avail_len = __input.len();
8192 let mut payload_buf = [0; Self::ENCODED_LEN];
8193 let mut buf = if avail_len < Self::ENCODED_LEN {
8194 payload_buf[0..avail_len].copy_from_slice(__input);
8195 Bytes::new(&payload_buf)
8196 } else {
8197 Bytes::new(__input)
8198 };
8199 let mut __struct = Self::default();
8200 __struct.time_boot_ms = buf.get_u32_le();
8201 __struct.max = buf.get_f32_le();
8202 __struct.max_point_x = buf.get_f32_le();
8203 __struct.max_point_y = buf.get_f32_le();
8204 __struct.min = buf.get_f32_le();
8205 __struct.min_point_x = buf.get_f32_le();
8206 __struct.min_point_y = buf.get_f32_le();
8207 __struct.stream_id = buf.get_u8();
8208 __struct.camera_device_id = buf.get_u8();
8209 Ok(__struct)
8210 }
8211 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8212 let mut __tmp = BytesMut::new(bytes);
8213 #[allow(clippy::absurd_extreme_comparisons)]
8214 #[allow(unused_comparisons)]
8215 if __tmp.remaining() < Self::ENCODED_LEN {
8216 panic!(
8217 "buffer is too small (need {} bytes, but got {})",
8218 Self::ENCODED_LEN,
8219 __tmp.remaining(),
8220 )
8221 }
8222 __tmp.put_u32_le(self.time_boot_ms);
8223 __tmp.put_f32_le(self.max);
8224 __tmp.put_f32_le(self.max_point_x);
8225 __tmp.put_f32_le(self.max_point_y);
8226 __tmp.put_f32_le(self.min);
8227 __tmp.put_f32_le(self.min_point_x);
8228 __tmp.put_f32_le(self.min_point_y);
8229 __tmp.put_u8(self.stream_id);
8230 __tmp.put_u8(self.camera_device_id);
8231 if matches!(version, MavlinkVersion::V2) {
8232 let len = __tmp.len();
8233 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8234 } else {
8235 __tmp.len()
8236 }
8237 }
8238}
8239#[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
8240#[doc = ""]
8241#[doc = "ID: 276"]
8242#[derive(Debug, Clone, PartialEq)]
8243#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8244#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8245#[cfg_attr(feature = "ts", derive(TS))]
8246#[cfg_attr(feature = "ts", ts(export))]
8247pub struct CAMERA_TRACKING_GEO_STATUS_DATA {
8248 #[doc = "Latitude of tracked object"]
8249 pub lat: i32,
8250 #[doc = "Longitude of tracked object"]
8251 pub lon: i32,
8252 #[doc = "Altitude of tracked object(AMSL, WGS84)"]
8253 pub alt: f32,
8254 #[doc = "Horizontal accuracy. NAN if unknown"]
8255 pub h_acc: f32,
8256 #[doc = "Vertical accuracy. NAN if unknown"]
8257 pub v_acc: f32,
8258 #[doc = "North velocity of tracked object. NAN if unknown"]
8259 pub vel_n: f32,
8260 #[doc = "East velocity of tracked object. NAN if unknown"]
8261 pub vel_e: f32,
8262 #[doc = "Down velocity of tracked object. NAN if unknown"]
8263 pub vel_d: f32,
8264 #[doc = "Velocity accuracy. NAN if unknown"]
8265 pub vel_acc: f32,
8266 #[doc = "Distance between camera and tracked object. NAN if unknown"]
8267 pub dist: f32,
8268 #[doc = "Heading in radians, in NED. NAN if unknown"]
8269 pub hdg: f32,
8270 #[doc = "Accuracy of heading, in NED. NAN if unknown"]
8271 pub hdg_acc: f32,
8272 #[doc = "Current tracking status"]
8273 pub tracking_status: CameraTrackingStatusFlags,
8274 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
8275 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8276 pub camera_device_id: u8,
8277}
8278impl CAMERA_TRACKING_GEO_STATUS_DATA {
8279 pub const ENCODED_LEN: usize = 50usize;
8280 pub const DEFAULT: Self = Self {
8281 lat: 0_i32,
8282 lon: 0_i32,
8283 alt: 0.0_f32,
8284 h_acc: 0.0_f32,
8285 v_acc: 0.0_f32,
8286 vel_n: 0.0_f32,
8287 vel_e: 0.0_f32,
8288 vel_d: 0.0_f32,
8289 vel_acc: 0.0_f32,
8290 dist: 0.0_f32,
8291 hdg: 0.0_f32,
8292 hdg_acc: 0.0_f32,
8293 tracking_status: CameraTrackingStatusFlags::DEFAULT,
8294 camera_device_id: 0_u8,
8295 };
8296 #[cfg(feature = "arbitrary")]
8297 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8298 use arbitrary::{Arbitrary, Unstructured};
8299 let mut buf = [0u8; 1024];
8300 rng.fill_bytes(&mut buf);
8301 let mut unstructured = Unstructured::new(&buf);
8302 Self::arbitrary(&mut unstructured).unwrap_or_default()
8303 }
8304}
8305impl Default for CAMERA_TRACKING_GEO_STATUS_DATA {
8306 fn default() -> Self {
8307 Self::DEFAULT.clone()
8308 }
8309}
8310impl MessageData for CAMERA_TRACKING_GEO_STATUS_DATA {
8311 type Message = MavMessage;
8312 const ID: u32 = 276u32;
8313 const NAME: &'static str = "CAMERA_TRACKING_GEO_STATUS";
8314 const EXTRA_CRC: u8 = 18u8;
8315 const ENCODED_LEN: usize = 50usize;
8316 fn deser(
8317 _version: MavlinkVersion,
8318 __input: &[u8],
8319 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8320 let avail_len = __input.len();
8321 let mut payload_buf = [0; Self::ENCODED_LEN];
8322 let mut buf = if avail_len < Self::ENCODED_LEN {
8323 payload_buf[0..avail_len].copy_from_slice(__input);
8324 Bytes::new(&payload_buf)
8325 } else {
8326 Bytes::new(__input)
8327 };
8328 let mut __struct = Self::default();
8329 __struct.lat = buf.get_i32_le();
8330 __struct.lon = buf.get_i32_le();
8331 __struct.alt = buf.get_f32_le();
8332 __struct.h_acc = buf.get_f32_le();
8333 __struct.v_acc = buf.get_f32_le();
8334 __struct.vel_n = buf.get_f32_le();
8335 __struct.vel_e = buf.get_f32_le();
8336 __struct.vel_d = buf.get_f32_le();
8337 __struct.vel_acc = buf.get_f32_le();
8338 __struct.dist = buf.get_f32_le();
8339 __struct.hdg = buf.get_f32_le();
8340 __struct.hdg_acc = buf.get_f32_le();
8341 let tmp = buf.get_u8();
8342 __struct.tracking_status =
8343 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8344 enum_type: "CameraTrackingStatusFlags",
8345 value: tmp as u32,
8346 })?;
8347 __struct.camera_device_id = buf.get_u8();
8348 Ok(__struct)
8349 }
8350 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8351 let mut __tmp = BytesMut::new(bytes);
8352 #[allow(clippy::absurd_extreme_comparisons)]
8353 #[allow(unused_comparisons)]
8354 if __tmp.remaining() < Self::ENCODED_LEN {
8355 panic!(
8356 "buffer is too small (need {} bytes, but got {})",
8357 Self::ENCODED_LEN,
8358 __tmp.remaining(),
8359 )
8360 }
8361 __tmp.put_i32_le(self.lat);
8362 __tmp.put_i32_le(self.lon);
8363 __tmp.put_f32_le(self.alt);
8364 __tmp.put_f32_le(self.h_acc);
8365 __tmp.put_f32_le(self.v_acc);
8366 __tmp.put_f32_le(self.vel_n);
8367 __tmp.put_f32_le(self.vel_e);
8368 __tmp.put_f32_le(self.vel_d);
8369 __tmp.put_f32_le(self.vel_acc);
8370 __tmp.put_f32_le(self.dist);
8371 __tmp.put_f32_le(self.hdg);
8372 __tmp.put_f32_le(self.hdg_acc);
8373 __tmp.put_u8(self.tracking_status as u8);
8374 if matches!(version, MavlinkVersion::V2) {
8375 __tmp.put_u8(self.camera_device_id);
8376 let len = __tmp.len();
8377 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8378 } else {
8379 __tmp.len()
8380 }
8381 }
8382}
8383#[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
8384#[doc = ""]
8385#[doc = "ID: 275"]
8386#[derive(Debug, Clone, PartialEq)]
8387#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8388#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8389#[cfg_attr(feature = "ts", derive(TS))]
8390#[cfg_attr(feature = "ts", ts(export))]
8391pub struct CAMERA_TRACKING_IMAGE_STATUS_DATA {
8392 #[doc = "Current tracked point x value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
8393 pub point_x: f32,
8394 #[doc = "Current tracked point y value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
8395 pub point_y: f32,
8396 #[doc = "Current tracked radius if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is image left, 1 is image right), NAN if unknown"]
8397 pub radius: f32,
8398 #[doc = "Current tracked rectangle top x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
8399 pub rec_top_x: f32,
8400 #[doc = "Current tracked rectangle top y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
8401 pub rec_top_y: f32,
8402 #[doc = "Current tracked rectangle bottom x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
8403 pub rec_bottom_x: f32,
8404 #[doc = "Current tracked rectangle bottom y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
8405 pub rec_bottom_y: f32,
8406 #[doc = "Current tracking status"]
8407 pub tracking_status: CameraTrackingStatusFlags,
8408 #[doc = "Current tracking mode"]
8409 pub tracking_mode: CameraTrackingMode,
8410 #[doc = "Defines location of target data"]
8411 pub target_data: CameraTrackingTargetData,
8412 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
8413 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8414 pub camera_device_id: u8,
8415}
8416impl CAMERA_TRACKING_IMAGE_STATUS_DATA {
8417 pub const ENCODED_LEN: usize = 32usize;
8418 pub const DEFAULT: Self = Self {
8419 point_x: 0.0_f32,
8420 point_y: 0.0_f32,
8421 radius: 0.0_f32,
8422 rec_top_x: 0.0_f32,
8423 rec_top_y: 0.0_f32,
8424 rec_bottom_x: 0.0_f32,
8425 rec_bottom_y: 0.0_f32,
8426 tracking_status: CameraTrackingStatusFlags::DEFAULT,
8427 tracking_mode: CameraTrackingMode::DEFAULT,
8428 target_data: CameraTrackingTargetData::DEFAULT,
8429 camera_device_id: 0_u8,
8430 };
8431 #[cfg(feature = "arbitrary")]
8432 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8433 use arbitrary::{Arbitrary, Unstructured};
8434 let mut buf = [0u8; 1024];
8435 rng.fill_bytes(&mut buf);
8436 let mut unstructured = Unstructured::new(&buf);
8437 Self::arbitrary(&mut unstructured).unwrap_or_default()
8438 }
8439}
8440impl Default for CAMERA_TRACKING_IMAGE_STATUS_DATA {
8441 fn default() -> Self {
8442 Self::DEFAULT.clone()
8443 }
8444}
8445impl MessageData for CAMERA_TRACKING_IMAGE_STATUS_DATA {
8446 type Message = MavMessage;
8447 const ID: u32 = 275u32;
8448 const NAME: &'static str = "CAMERA_TRACKING_IMAGE_STATUS";
8449 const EXTRA_CRC: u8 = 126u8;
8450 const ENCODED_LEN: usize = 32usize;
8451 fn deser(
8452 _version: MavlinkVersion,
8453 __input: &[u8],
8454 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8455 let avail_len = __input.len();
8456 let mut payload_buf = [0; Self::ENCODED_LEN];
8457 let mut buf = if avail_len < Self::ENCODED_LEN {
8458 payload_buf[0..avail_len].copy_from_slice(__input);
8459 Bytes::new(&payload_buf)
8460 } else {
8461 Bytes::new(__input)
8462 };
8463 let mut __struct = Self::default();
8464 __struct.point_x = buf.get_f32_le();
8465 __struct.point_y = buf.get_f32_le();
8466 __struct.radius = buf.get_f32_le();
8467 __struct.rec_top_x = buf.get_f32_le();
8468 __struct.rec_top_y = buf.get_f32_le();
8469 __struct.rec_bottom_x = buf.get_f32_le();
8470 __struct.rec_bottom_y = buf.get_f32_le();
8471 let tmp = buf.get_u8();
8472 __struct.tracking_status =
8473 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8474 enum_type: "CameraTrackingStatusFlags",
8475 value: tmp as u32,
8476 })?;
8477 let tmp = buf.get_u8();
8478 __struct.tracking_mode =
8479 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8480 enum_type: "CameraTrackingMode",
8481 value: tmp as u32,
8482 })?;
8483 let tmp = buf.get_u8();
8484 __struct.target_data =
8485 CameraTrackingTargetData::from_bits(tmp & CameraTrackingTargetData::all().bits())
8486 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
8487 flag_type: "CameraTrackingTargetData",
8488 value: tmp as u32,
8489 })?;
8490 __struct.camera_device_id = buf.get_u8();
8491 Ok(__struct)
8492 }
8493 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8494 let mut __tmp = BytesMut::new(bytes);
8495 #[allow(clippy::absurd_extreme_comparisons)]
8496 #[allow(unused_comparisons)]
8497 if __tmp.remaining() < Self::ENCODED_LEN {
8498 panic!(
8499 "buffer is too small (need {} bytes, but got {})",
8500 Self::ENCODED_LEN,
8501 __tmp.remaining(),
8502 )
8503 }
8504 __tmp.put_f32_le(self.point_x);
8505 __tmp.put_f32_le(self.point_y);
8506 __tmp.put_f32_le(self.radius);
8507 __tmp.put_f32_le(self.rec_top_x);
8508 __tmp.put_f32_le(self.rec_top_y);
8509 __tmp.put_f32_le(self.rec_bottom_x);
8510 __tmp.put_f32_le(self.rec_bottom_y);
8511 __tmp.put_u8(self.tracking_status as u8);
8512 __tmp.put_u8(self.tracking_mode as u8);
8513 __tmp.put_u8(self.target_data.bits());
8514 if matches!(version, MavlinkVersion::V2) {
8515 __tmp.put_u8(self.camera_device_id);
8516 let len = __tmp.len();
8517 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8518 } else {
8519 __tmp.len()
8520 }
8521 }
8522}
8523#[doc = "Camera-IMU triggering and synchronisation message."]
8524#[doc = ""]
8525#[doc = "ID: 112"]
8526#[derive(Debug, Clone, PartialEq)]
8527#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8528#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8529#[cfg_attr(feature = "ts", derive(TS))]
8530#[cfg_attr(feature = "ts", ts(export))]
8531pub struct CAMERA_TRIGGER_DATA {
8532 #[doc = "Timestamp for image frame (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
8533 pub time_usec: u64,
8534 #[doc = "Image frame sequence"]
8535 pub seq: u32,
8536}
8537impl CAMERA_TRIGGER_DATA {
8538 pub const ENCODED_LEN: usize = 12usize;
8539 pub const DEFAULT: Self = Self {
8540 time_usec: 0_u64,
8541 seq: 0_u32,
8542 };
8543 #[cfg(feature = "arbitrary")]
8544 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8545 use arbitrary::{Arbitrary, Unstructured};
8546 let mut buf = [0u8; 1024];
8547 rng.fill_bytes(&mut buf);
8548 let mut unstructured = Unstructured::new(&buf);
8549 Self::arbitrary(&mut unstructured).unwrap_or_default()
8550 }
8551}
8552impl Default for CAMERA_TRIGGER_DATA {
8553 fn default() -> Self {
8554 Self::DEFAULT.clone()
8555 }
8556}
8557impl MessageData for CAMERA_TRIGGER_DATA {
8558 type Message = MavMessage;
8559 const ID: u32 = 112u32;
8560 const NAME: &'static str = "CAMERA_TRIGGER";
8561 const EXTRA_CRC: u8 = 174u8;
8562 const ENCODED_LEN: usize = 12usize;
8563 fn deser(
8564 _version: MavlinkVersion,
8565 __input: &[u8],
8566 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8567 let avail_len = __input.len();
8568 let mut payload_buf = [0; Self::ENCODED_LEN];
8569 let mut buf = if avail_len < Self::ENCODED_LEN {
8570 payload_buf[0..avail_len].copy_from_slice(__input);
8571 Bytes::new(&payload_buf)
8572 } else {
8573 Bytes::new(__input)
8574 };
8575 let mut __struct = Self::default();
8576 __struct.time_usec = buf.get_u64_le();
8577 __struct.seq = buf.get_u32_le();
8578 Ok(__struct)
8579 }
8580 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8581 let mut __tmp = BytesMut::new(bytes);
8582 #[allow(clippy::absurd_extreme_comparisons)]
8583 #[allow(unused_comparisons)]
8584 if __tmp.remaining() < Self::ENCODED_LEN {
8585 panic!(
8586 "buffer is too small (need {} bytes, but got {})",
8587 Self::ENCODED_LEN,
8588 __tmp.remaining(),
8589 )
8590 }
8591 __tmp.put_u64_le(self.time_usec);
8592 __tmp.put_u32_le(self.seq);
8593 if matches!(version, MavlinkVersion::V2) {
8594 let len = __tmp.len();
8595 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8596 } else {
8597 __tmp.len()
8598 }
8599 }
8600}
8601#[doc = "A forwarded CANFD frame as requested by MAV_CMD_CAN_FORWARD. These are separated from CAN_FRAME as they need different handling (eg. TAO handling)."]
8602#[doc = ""]
8603#[doc = "ID: 387"]
8604#[derive(Debug, Clone, PartialEq)]
8605#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8606#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8607#[cfg_attr(feature = "ts", derive(TS))]
8608#[cfg_attr(feature = "ts", ts(export))]
8609pub struct CANFD_FRAME_DATA {
8610 #[doc = "Frame ID"]
8611 pub id: u32,
8612 #[doc = "System ID."]
8613 pub target_system: u8,
8614 #[doc = "Component ID."]
8615 pub target_component: u8,
8616 #[doc = "bus number"]
8617 pub bus: u8,
8618 #[doc = "Frame length"]
8619 pub len: u8,
8620 #[doc = "Frame data"]
8621 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8622 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
8623 pub data: [u8; 64],
8624}
8625impl CANFD_FRAME_DATA {
8626 pub const ENCODED_LEN: usize = 72usize;
8627 pub const DEFAULT: Self = Self {
8628 id: 0_u32,
8629 target_system: 0_u8,
8630 target_component: 0_u8,
8631 bus: 0_u8,
8632 len: 0_u8,
8633 data: [0_u8; 64usize],
8634 };
8635 #[cfg(feature = "arbitrary")]
8636 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8637 use arbitrary::{Arbitrary, Unstructured};
8638 let mut buf = [0u8; 1024];
8639 rng.fill_bytes(&mut buf);
8640 let mut unstructured = Unstructured::new(&buf);
8641 Self::arbitrary(&mut unstructured).unwrap_or_default()
8642 }
8643}
8644impl Default for CANFD_FRAME_DATA {
8645 fn default() -> Self {
8646 Self::DEFAULT.clone()
8647 }
8648}
8649impl MessageData for CANFD_FRAME_DATA {
8650 type Message = MavMessage;
8651 const ID: u32 = 387u32;
8652 const NAME: &'static str = "CANFD_FRAME";
8653 const EXTRA_CRC: u8 = 4u8;
8654 const ENCODED_LEN: usize = 72usize;
8655 fn deser(
8656 _version: MavlinkVersion,
8657 __input: &[u8],
8658 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8659 let avail_len = __input.len();
8660 let mut payload_buf = [0; Self::ENCODED_LEN];
8661 let mut buf = if avail_len < Self::ENCODED_LEN {
8662 payload_buf[0..avail_len].copy_from_slice(__input);
8663 Bytes::new(&payload_buf)
8664 } else {
8665 Bytes::new(__input)
8666 };
8667 let mut __struct = Self::default();
8668 __struct.id = buf.get_u32_le();
8669 __struct.target_system = buf.get_u8();
8670 __struct.target_component = buf.get_u8();
8671 __struct.bus = buf.get_u8();
8672 __struct.len = buf.get_u8();
8673 for v in &mut __struct.data {
8674 let val = buf.get_u8();
8675 *v = val;
8676 }
8677 Ok(__struct)
8678 }
8679 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8680 let mut __tmp = BytesMut::new(bytes);
8681 #[allow(clippy::absurd_extreme_comparisons)]
8682 #[allow(unused_comparisons)]
8683 if __tmp.remaining() < Self::ENCODED_LEN {
8684 panic!(
8685 "buffer is too small (need {} bytes, but got {})",
8686 Self::ENCODED_LEN,
8687 __tmp.remaining(),
8688 )
8689 }
8690 __tmp.put_u32_le(self.id);
8691 __tmp.put_u8(self.target_system);
8692 __tmp.put_u8(self.target_component);
8693 __tmp.put_u8(self.bus);
8694 __tmp.put_u8(self.len);
8695 for val in &self.data {
8696 __tmp.put_u8(*val);
8697 }
8698 if matches!(version, MavlinkVersion::V2) {
8699 let len = __tmp.len();
8700 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8701 } else {
8702 __tmp.len()
8703 }
8704 }
8705}
8706#[doc = "Modify the filter of what CAN messages to forward over the mavlink. This can be used to make CAN forwarding work well on low bandwidth links. The filtering is applied on bits 8 to 24 of the CAN id (2nd and 3rd bytes) which corresponds to the DroneCAN message ID for DroneCAN. Filters with more than 16 IDs can be constructed by sending multiple CAN_FILTER_MODIFY messages."]
8707#[doc = ""]
8708#[doc = "ID: 388"]
8709#[derive(Debug, Clone, PartialEq)]
8710#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8711#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8712#[cfg_attr(feature = "ts", derive(TS))]
8713#[cfg_attr(feature = "ts", ts(export))]
8714pub struct CAN_FILTER_MODIFY_DATA {
8715 #[doc = "filter IDs, length num_ids"]
8716 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8717 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
8718 pub ids: [u16; 16],
8719 #[doc = "System ID."]
8720 pub target_system: u8,
8721 #[doc = "Component ID."]
8722 pub target_component: u8,
8723 #[doc = "bus number"]
8724 pub bus: u8,
8725 #[doc = "what operation to perform on the filter list. See CAN_FILTER_OP enum."]
8726 pub operation: CanFilterOp,
8727 #[doc = "number of IDs in filter list"]
8728 pub num_ids: u8,
8729}
8730impl CAN_FILTER_MODIFY_DATA {
8731 pub const ENCODED_LEN: usize = 37usize;
8732 pub const DEFAULT: Self = Self {
8733 ids: [0_u16; 16usize],
8734 target_system: 0_u8,
8735 target_component: 0_u8,
8736 bus: 0_u8,
8737 operation: CanFilterOp::DEFAULT,
8738 num_ids: 0_u8,
8739 };
8740 #[cfg(feature = "arbitrary")]
8741 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8742 use arbitrary::{Arbitrary, Unstructured};
8743 let mut buf = [0u8; 1024];
8744 rng.fill_bytes(&mut buf);
8745 let mut unstructured = Unstructured::new(&buf);
8746 Self::arbitrary(&mut unstructured).unwrap_or_default()
8747 }
8748}
8749impl Default for CAN_FILTER_MODIFY_DATA {
8750 fn default() -> Self {
8751 Self::DEFAULT.clone()
8752 }
8753}
8754impl MessageData for CAN_FILTER_MODIFY_DATA {
8755 type Message = MavMessage;
8756 const ID: u32 = 388u32;
8757 const NAME: &'static str = "CAN_FILTER_MODIFY";
8758 const EXTRA_CRC: u8 = 8u8;
8759 const ENCODED_LEN: usize = 37usize;
8760 fn deser(
8761 _version: MavlinkVersion,
8762 __input: &[u8],
8763 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8764 let avail_len = __input.len();
8765 let mut payload_buf = [0; Self::ENCODED_LEN];
8766 let mut buf = if avail_len < Self::ENCODED_LEN {
8767 payload_buf[0..avail_len].copy_from_slice(__input);
8768 Bytes::new(&payload_buf)
8769 } else {
8770 Bytes::new(__input)
8771 };
8772 let mut __struct = Self::default();
8773 for v in &mut __struct.ids {
8774 let val = buf.get_u16_le();
8775 *v = val;
8776 }
8777 __struct.target_system = buf.get_u8();
8778 __struct.target_component = buf.get_u8();
8779 __struct.bus = buf.get_u8();
8780 let tmp = buf.get_u8();
8781 __struct.operation =
8782 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8783 enum_type: "CanFilterOp",
8784 value: tmp as u32,
8785 })?;
8786 __struct.num_ids = buf.get_u8();
8787 Ok(__struct)
8788 }
8789 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8790 let mut __tmp = BytesMut::new(bytes);
8791 #[allow(clippy::absurd_extreme_comparisons)]
8792 #[allow(unused_comparisons)]
8793 if __tmp.remaining() < Self::ENCODED_LEN {
8794 panic!(
8795 "buffer is too small (need {} bytes, but got {})",
8796 Self::ENCODED_LEN,
8797 __tmp.remaining(),
8798 )
8799 }
8800 for val in &self.ids {
8801 __tmp.put_u16_le(*val);
8802 }
8803 __tmp.put_u8(self.target_system);
8804 __tmp.put_u8(self.target_component);
8805 __tmp.put_u8(self.bus);
8806 __tmp.put_u8(self.operation as u8);
8807 __tmp.put_u8(self.num_ids);
8808 if matches!(version, MavlinkVersion::V2) {
8809 let len = __tmp.len();
8810 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8811 } else {
8812 __tmp.len()
8813 }
8814 }
8815}
8816#[doc = "A forwarded CAN frame as requested by MAV_CMD_CAN_FORWARD."]
8817#[doc = ""]
8818#[doc = "ID: 386"]
8819#[derive(Debug, Clone, PartialEq)]
8820#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8821#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8822#[cfg_attr(feature = "ts", derive(TS))]
8823#[cfg_attr(feature = "ts", ts(export))]
8824pub struct CAN_FRAME_DATA {
8825 #[doc = "Frame ID"]
8826 pub id: u32,
8827 #[doc = "System ID."]
8828 pub target_system: u8,
8829 #[doc = "Component ID."]
8830 pub target_component: u8,
8831 #[doc = "Bus number"]
8832 pub bus: u8,
8833 #[doc = "Frame length"]
8834 pub len: u8,
8835 #[doc = "Frame data"]
8836 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8837 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
8838 pub data: [u8; 8],
8839}
8840impl CAN_FRAME_DATA {
8841 pub const ENCODED_LEN: usize = 16usize;
8842 pub const DEFAULT: Self = Self {
8843 id: 0_u32,
8844 target_system: 0_u8,
8845 target_component: 0_u8,
8846 bus: 0_u8,
8847 len: 0_u8,
8848 data: [0_u8; 8usize],
8849 };
8850 #[cfg(feature = "arbitrary")]
8851 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8852 use arbitrary::{Arbitrary, Unstructured};
8853 let mut buf = [0u8; 1024];
8854 rng.fill_bytes(&mut buf);
8855 let mut unstructured = Unstructured::new(&buf);
8856 Self::arbitrary(&mut unstructured).unwrap_or_default()
8857 }
8858}
8859impl Default for CAN_FRAME_DATA {
8860 fn default() -> Self {
8861 Self::DEFAULT.clone()
8862 }
8863}
8864impl MessageData for CAN_FRAME_DATA {
8865 type Message = MavMessage;
8866 const ID: u32 = 386u32;
8867 const NAME: &'static str = "CAN_FRAME";
8868 const EXTRA_CRC: u8 = 132u8;
8869 const ENCODED_LEN: usize = 16usize;
8870 fn deser(
8871 _version: MavlinkVersion,
8872 __input: &[u8],
8873 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8874 let avail_len = __input.len();
8875 let mut payload_buf = [0; Self::ENCODED_LEN];
8876 let mut buf = if avail_len < Self::ENCODED_LEN {
8877 payload_buf[0..avail_len].copy_from_slice(__input);
8878 Bytes::new(&payload_buf)
8879 } else {
8880 Bytes::new(__input)
8881 };
8882 let mut __struct = Self::default();
8883 __struct.id = buf.get_u32_le();
8884 __struct.target_system = buf.get_u8();
8885 __struct.target_component = buf.get_u8();
8886 __struct.bus = buf.get_u8();
8887 __struct.len = buf.get_u8();
8888 for v in &mut __struct.data {
8889 let val = buf.get_u8();
8890 *v = val;
8891 }
8892 Ok(__struct)
8893 }
8894 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8895 let mut __tmp = BytesMut::new(bytes);
8896 #[allow(clippy::absurd_extreme_comparisons)]
8897 #[allow(unused_comparisons)]
8898 if __tmp.remaining() < Self::ENCODED_LEN {
8899 panic!(
8900 "buffer is too small (need {} bytes, but got {})",
8901 Self::ENCODED_LEN,
8902 __tmp.remaining(),
8903 )
8904 }
8905 __tmp.put_u32_le(self.id);
8906 __tmp.put_u8(self.target_system);
8907 __tmp.put_u8(self.target_component);
8908 __tmp.put_u8(self.bus);
8909 __tmp.put_u8(self.len);
8910 for val in &self.data {
8911 __tmp.put_u8(*val);
8912 }
8913 if matches!(version, MavlinkVersion::V2) {
8914 let len = __tmp.len();
8915 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8916 } else {
8917 __tmp.len()
8918 }
8919 }
8920}
8921#[doc = "Configure cellular modems. This message is re-emitted as an acknowledgement by the modem. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
8922#[doc = ""]
8923#[doc = "ID: 336"]
8924#[derive(Debug, Clone, PartialEq)]
8925#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8926#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8927#[cfg_attr(feature = "ts", derive(TS))]
8928#[cfg_attr(feature = "ts", ts(export))]
8929pub struct CELLULAR_CONFIG_DATA {
8930 #[doc = "Enable/disable LTE. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8931 pub enable_lte: u8,
8932 #[doc = "Enable/disable PIN on the SIM card. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8933 pub enable_pin: u8,
8934 #[doc = "PIN sent to the SIM card. Blank when PIN is disabled. Empty when message is sent back as a response."]
8935 #[cfg_attr(
8936 feature = "serde",
8937 serde(
8938 serialize_with = "crate::nulstr::serialize::<_, 16>",
8939 deserialize_with = "crate::nulstr::deserialize::<_, 16>"
8940 )
8941 )]
8942 #[cfg_attr(feature = "ts", ts(type = "string"))]
8943 pub pin: [u8; 16],
8944 #[doc = "New PIN when changing the PIN. Blank to leave it unchanged. Empty when message is sent back as a response."]
8945 #[cfg_attr(
8946 feature = "serde",
8947 serde(
8948 serialize_with = "crate::nulstr::serialize::<_, 16>",
8949 deserialize_with = "crate::nulstr::deserialize::<_, 16>"
8950 )
8951 )]
8952 #[cfg_attr(feature = "ts", ts(type = "string"))]
8953 pub new_pin: [u8; 16],
8954 #[doc = "Name of the cellular APN. Blank to leave it unchanged. Current APN when sent back as a response."]
8955 #[cfg_attr(
8956 feature = "serde",
8957 serde(
8958 serialize_with = "crate::nulstr::serialize::<_, 32>",
8959 deserialize_with = "crate::nulstr::deserialize::<_, 32>"
8960 )
8961 )]
8962 #[cfg_attr(feature = "ts", ts(type = "string"))]
8963 pub apn: [u8; 32],
8964 #[doc = "Required PUK code in case the user failed to authenticate 3 times with the PIN. Empty when message is sent back as a response."]
8965 #[cfg_attr(
8966 feature = "serde",
8967 serde(
8968 serialize_with = "crate::nulstr::serialize::<_, 16>",
8969 deserialize_with = "crate::nulstr::deserialize::<_, 16>"
8970 )
8971 )]
8972 #[cfg_attr(feature = "ts", ts(type = "string"))]
8973 pub puk: [u8; 16],
8974 #[doc = "Enable/disable roaming. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8975 pub roaming: u8,
8976 #[doc = "Message acceptance response (sent back to GS)."]
8977 pub response: CellularConfigResponse,
8978}
8979impl CELLULAR_CONFIG_DATA {
8980 pub const ENCODED_LEN: usize = 84usize;
8981 pub const DEFAULT: Self = Self {
8982 enable_lte: 0_u8,
8983 enable_pin: 0_u8,
8984 pin: [0_u8; 16usize],
8985 new_pin: [0_u8; 16usize],
8986 apn: [0_u8; 32usize],
8987 puk: [0_u8; 16usize],
8988 roaming: 0_u8,
8989 response: CellularConfigResponse::DEFAULT,
8990 };
8991 #[cfg(feature = "arbitrary")]
8992 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8993 use arbitrary::{Arbitrary, Unstructured};
8994 let mut buf = [0u8; 1024];
8995 rng.fill_bytes(&mut buf);
8996 let mut unstructured = Unstructured::new(&buf);
8997 Self::arbitrary(&mut unstructured).unwrap_or_default()
8998 }
8999}
9000impl Default for CELLULAR_CONFIG_DATA {
9001 fn default() -> Self {
9002 Self::DEFAULT.clone()
9003 }
9004}
9005impl MessageData for CELLULAR_CONFIG_DATA {
9006 type Message = MavMessage;
9007 const ID: u32 = 336u32;
9008 const NAME: &'static str = "CELLULAR_CONFIG";
9009 const EXTRA_CRC: u8 = 245u8;
9010 const ENCODED_LEN: usize = 84usize;
9011 fn deser(
9012 _version: MavlinkVersion,
9013 __input: &[u8],
9014 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9015 let avail_len = __input.len();
9016 let mut payload_buf = [0; Self::ENCODED_LEN];
9017 let mut buf = if avail_len < Self::ENCODED_LEN {
9018 payload_buf[0..avail_len].copy_from_slice(__input);
9019 Bytes::new(&payload_buf)
9020 } else {
9021 Bytes::new(__input)
9022 };
9023 let mut __struct = Self::default();
9024 __struct.enable_lte = buf.get_u8();
9025 __struct.enable_pin = buf.get_u8();
9026 for v in &mut __struct.pin {
9027 let val = buf.get_u8();
9028 *v = val;
9029 }
9030 for v in &mut __struct.new_pin {
9031 let val = buf.get_u8();
9032 *v = val;
9033 }
9034 for v in &mut __struct.apn {
9035 let val = buf.get_u8();
9036 *v = val;
9037 }
9038 for v in &mut __struct.puk {
9039 let val = buf.get_u8();
9040 *v = val;
9041 }
9042 __struct.roaming = buf.get_u8();
9043 let tmp = buf.get_u8();
9044 __struct.response =
9045 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9046 enum_type: "CellularConfigResponse",
9047 value: tmp as u32,
9048 })?;
9049 Ok(__struct)
9050 }
9051 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9052 let mut __tmp = BytesMut::new(bytes);
9053 #[allow(clippy::absurd_extreme_comparisons)]
9054 #[allow(unused_comparisons)]
9055 if __tmp.remaining() < Self::ENCODED_LEN {
9056 panic!(
9057 "buffer is too small (need {} bytes, but got {})",
9058 Self::ENCODED_LEN,
9059 __tmp.remaining(),
9060 )
9061 }
9062 __tmp.put_u8(self.enable_lte);
9063 __tmp.put_u8(self.enable_pin);
9064 for val in &self.pin {
9065 __tmp.put_u8(*val);
9066 }
9067 for val in &self.new_pin {
9068 __tmp.put_u8(*val);
9069 }
9070 for val in &self.apn {
9071 __tmp.put_u8(*val);
9072 }
9073 for val in &self.puk {
9074 __tmp.put_u8(*val);
9075 }
9076 __tmp.put_u8(self.roaming);
9077 __tmp.put_u8(self.response as u8);
9078 if matches!(version, MavlinkVersion::V2) {
9079 let len = __tmp.len();
9080 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9081 } else {
9082 __tmp.len()
9083 }
9084 }
9085}
9086#[doc = "Report current used cellular network status."]
9087#[doc = ""]
9088#[doc = "ID: 334"]
9089#[derive(Debug, Clone, PartialEq)]
9090#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9091#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9092#[cfg_attr(feature = "ts", derive(TS))]
9093#[cfg_attr(feature = "ts", ts(export))]
9094pub struct CELLULAR_STATUS_DATA {
9095 #[doc = "Mobile country code. If unknown, set to UINT16_MAX"]
9096 pub mcc: u16,
9097 #[doc = "Mobile network code. If unknown, set to UINT16_MAX"]
9098 pub mnc: u16,
9099 #[doc = "Location area code. If unknown, set to 0"]
9100 pub lac: u16,
9101 #[doc = "Cellular modem status"]
9102 pub status: CellularStatusFlag,
9103 #[doc = "Failure reason when status in in CELLULAR_STATUS_FLAG_FAILED"]
9104 pub failure_reason: CellularNetworkFailedReason,
9105 #[doc = "Cellular network radio type: gsm, cdma, lte..."]
9106 pub mavtype: CellularNetworkRadioType,
9107 #[doc = "Signal quality in percent. If unknown, set to UINT8_MAX"]
9108 pub quality: u8,
9109}
9110impl CELLULAR_STATUS_DATA {
9111 pub const ENCODED_LEN: usize = 10usize;
9112 pub const DEFAULT: Self = Self {
9113 mcc: 0_u16,
9114 mnc: 0_u16,
9115 lac: 0_u16,
9116 status: CellularStatusFlag::DEFAULT,
9117 failure_reason: CellularNetworkFailedReason::DEFAULT,
9118 mavtype: CellularNetworkRadioType::DEFAULT,
9119 quality: 0_u8,
9120 };
9121 #[cfg(feature = "arbitrary")]
9122 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9123 use arbitrary::{Arbitrary, Unstructured};
9124 let mut buf = [0u8; 1024];
9125 rng.fill_bytes(&mut buf);
9126 let mut unstructured = Unstructured::new(&buf);
9127 Self::arbitrary(&mut unstructured).unwrap_or_default()
9128 }
9129}
9130impl Default for CELLULAR_STATUS_DATA {
9131 fn default() -> Self {
9132 Self::DEFAULT.clone()
9133 }
9134}
9135impl MessageData for CELLULAR_STATUS_DATA {
9136 type Message = MavMessage;
9137 const ID: u32 = 334u32;
9138 const NAME: &'static str = "CELLULAR_STATUS";
9139 const EXTRA_CRC: u8 = 72u8;
9140 const ENCODED_LEN: usize = 10usize;
9141 fn deser(
9142 _version: MavlinkVersion,
9143 __input: &[u8],
9144 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9145 let avail_len = __input.len();
9146 let mut payload_buf = [0; Self::ENCODED_LEN];
9147 let mut buf = if avail_len < Self::ENCODED_LEN {
9148 payload_buf[0..avail_len].copy_from_slice(__input);
9149 Bytes::new(&payload_buf)
9150 } else {
9151 Bytes::new(__input)
9152 };
9153 let mut __struct = Self::default();
9154 __struct.mcc = buf.get_u16_le();
9155 __struct.mnc = buf.get_u16_le();
9156 __struct.lac = buf.get_u16_le();
9157 let tmp = buf.get_u8();
9158 __struct.status =
9159 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9160 enum_type: "CellularStatusFlag",
9161 value: tmp as u32,
9162 })?;
9163 let tmp = buf.get_u8();
9164 __struct.failure_reason =
9165 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9166 enum_type: "CellularNetworkFailedReason",
9167 value: tmp as u32,
9168 })?;
9169 let tmp = buf.get_u8();
9170 __struct.mavtype =
9171 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9172 enum_type: "CellularNetworkRadioType",
9173 value: tmp as u32,
9174 })?;
9175 __struct.quality = buf.get_u8();
9176 Ok(__struct)
9177 }
9178 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9179 let mut __tmp = BytesMut::new(bytes);
9180 #[allow(clippy::absurd_extreme_comparisons)]
9181 #[allow(unused_comparisons)]
9182 if __tmp.remaining() < Self::ENCODED_LEN {
9183 panic!(
9184 "buffer is too small (need {} bytes, but got {})",
9185 Self::ENCODED_LEN,
9186 __tmp.remaining(),
9187 )
9188 }
9189 __tmp.put_u16_le(self.mcc);
9190 __tmp.put_u16_le(self.mnc);
9191 __tmp.put_u16_le(self.lac);
9192 __tmp.put_u8(self.status as u8);
9193 __tmp.put_u8(self.failure_reason as u8);
9194 __tmp.put_u8(self.mavtype as u8);
9195 __tmp.put_u8(self.quality);
9196 if matches!(version, MavlinkVersion::V2) {
9197 let len = __tmp.len();
9198 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9199 } else {
9200 __tmp.len()
9201 }
9202 }
9203}
9204#[doc = "Request to control this MAV."]
9205#[doc = ""]
9206#[doc = "ID: 5"]
9207#[derive(Debug, Clone, PartialEq)]
9208#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9209#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9210#[cfg_attr(feature = "ts", derive(TS))]
9211#[cfg_attr(feature = "ts", ts(export))]
9212pub struct CHANGE_OPERATOR_CONTROL_DATA {
9213 #[doc = "System the GCS requests control for"]
9214 pub target_system: u8,
9215 #[doc = "0: request control of this MAV, 1: Release control of this MAV"]
9216 pub control_request: u8,
9217 #[doc = "0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch."]
9218 pub version: u8,
9219 #[doc = "Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and \"!?,.-\""]
9220 #[cfg_attr(
9221 feature = "serde",
9222 serde(
9223 serialize_with = "crate::nulstr::serialize::<_, 25>",
9224 deserialize_with = "crate::nulstr::deserialize::<_, 25>"
9225 )
9226 )]
9227 #[cfg_attr(feature = "ts", ts(type = "string"))]
9228 pub passkey: [u8; 25],
9229}
9230impl CHANGE_OPERATOR_CONTROL_DATA {
9231 pub const ENCODED_LEN: usize = 28usize;
9232 pub const DEFAULT: Self = Self {
9233 target_system: 0_u8,
9234 control_request: 0_u8,
9235 version: 0_u8,
9236 passkey: [0_u8; 25usize],
9237 };
9238 #[cfg(feature = "arbitrary")]
9239 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9240 use arbitrary::{Arbitrary, Unstructured};
9241 let mut buf = [0u8; 1024];
9242 rng.fill_bytes(&mut buf);
9243 let mut unstructured = Unstructured::new(&buf);
9244 Self::arbitrary(&mut unstructured).unwrap_or_default()
9245 }
9246}
9247impl Default for CHANGE_OPERATOR_CONTROL_DATA {
9248 fn default() -> Self {
9249 Self::DEFAULT.clone()
9250 }
9251}
9252impl MessageData for CHANGE_OPERATOR_CONTROL_DATA {
9253 type Message = MavMessage;
9254 const ID: u32 = 5u32;
9255 const NAME: &'static str = "CHANGE_OPERATOR_CONTROL";
9256 const EXTRA_CRC: u8 = 217u8;
9257 const ENCODED_LEN: usize = 28usize;
9258 fn deser(
9259 _version: MavlinkVersion,
9260 __input: &[u8],
9261 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9262 let avail_len = __input.len();
9263 let mut payload_buf = [0; Self::ENCODED_LEN];
9264 let mut buf = if avail_len < Self::ENCODED_LEN {
9265 payload_buf[0..avail_len].copy_from_slice(__input);
9266 Bytes::new(&payload_buf)
9267 } else {
9268 Bytes::new(__input)
9269 };
9270 let mut __struct = Self::default();
9271 __struct.target_system = buf.get_u8();
9272 __struct.control_request = buf.get_u8();
9273 __struct.version = buf.get_u8();
9274 for v in &mut __struct.passkey {
9275 let val = buf.get_u8();
9276 *v = val;
9277 }
9278 Ok(__struct)
9279 }
9280 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9281 let mut __tmp = BytesMut::new(bytes);
9282 #[allow(clippy::absurd_extreme_comparisons)]
9283 #[allow(unused_comparisons)]
9284 if __tmp.remaining() < Self::ENCODED_LEN {
9285 panic!(
9286 "buffer is too small (need {} bytes, but got {})",
9287 Self::ENCODED_LEN,
9288 __tmp.remaining(),
9289 )
9290 }
9291 __tmp.put_u8(self.target_system);
9292 __tmp.put_u8(self.control_request);
9293 __tmp.put_u8(self.version);
9294 for val in &self.passkey {
9295 __tmp.put_u8(*val);
9296 }
9297 if matches!(version, MavlinkVersion::V2) {
9298 let len = __tmp.len();
9299 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9300 } else {
9301 __tmp.len()
9302 }
9303 }
9304}
9305#[doc = "Accept / deny control of this MAV."]
9306#[doc = ""]
9307#[doc = "ID: 6"]
9308#[derive(Debug, Clone, PartialEq)]
9309#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9310#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9311#[cfg_attr(feature = "ts", derive(TS))]
9312#[cfg_attr(feature = "ts", ts(export))]
9313pub struct CHANGE_OPERATOR_CONTROL_ACK_DATA {
9314 #[doc = "ID of the GCS this message"]
9315 pub gcs_system_id: u8,
9316 #[doc = "0: request control of this MAV, 1: Release control of this MAV"]
9317 pub control_request: u8,
9318 #[doc = "0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control"]
9319 pub ack: u8,
9320}
9321impl CHANGE_OPERATOR_CONTROL_ACK_DATA {
9322 pub const ENCODED_LEN: usize = 3usize;
9323 pub const DEFAULT: Self = Self {
9324 gcs_system_id: 0_u8,
9325 control_request: 0_u8,
9326 ack: 0_u8,
9327 };
9328 #[cfg(feature = "arbitrary")]
9329 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9330 use arbitrary::{Arbitrary, Unstructured};
9331 let mut buf = [0u8; 1024];
9332 rng.fill_bytes(&mut buf);
9333 let mut unstructured = Unstructured::new(&buf);
9334 Self::arbitrary(&mut unstructured).unwrap_or_default()
9335 }
9336}
9337impl Default for CHANGE_OPERATOR_CONTROL_ACK_DATA {
9338 fn default() -> Self {
9339 Self::DEFAULT.clone()
9340 }
9341}
9342impl MessageData for CHANGE_OPERATOR_CONTROL_ACK_DATA {
9343 type Message = MavMessage;
9344 const ID: u32 = 6u32;
9345 const NAME: &'static str = "CHANGE_OPERATOR_CONTROL_ACK";
9346 const EXTRA_CRC: u8 = 104u8;
9347 const ENCODED_LEN: usize = 3usize;
9348 fn deser(
9349 _version: MavlinkVersion,
9350 __input: &[u8],
9351 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9352 let avail_len = __input.len();
9353 let mut payload_buf = [0; Self::ENCODED_LEN];
9354 let mut buf = if avail_len < Self::ENCODED_LEN {
9355 payload_buf[0..avail_len].copy_from_slice(__input);
9356 Bytes::new(&payload_buf)
9357 } else {
9358 Bytes::new(__input)
9359 };
9360 let mut __struct = Self::default();
9361 __struct.gcs_system_id = buf.get_u8();
9362 __struct.control_request = buf.get_u8();
9363 __struct.ack = buf.get_u8();
9364 Ok(__struct)
9365 }
9366 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9367 let mut __tmp = BytesMut::new(bytes);
9368 #[allow(clippy::absurd_extreme_comparisons)]
9369 #[allow(unused_comparisons)]
9370 if __tmp.remaining() < Self::ENCODED_LEN {
9371 panic!(
9372 "buffer is too small (need {} bytes, but got {})",
9373 Self::ENCODED_LEN,
9374 __tmp.remaining(),
9375 )
9376 }
9377 __tmp.put_u8(self.gcs_system_id);
9378 __tmp.put_u8(self.control_request);
9379 __tmp.put_u8(self.ack);
9380 if matches!(version, MavlinkVersion::V2) {
9381 let len = __tmp.len();
9382 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9383 } else {
9384 __tmp.len()
9385 }
9386 }
9387}
9388#[doc = "Information about a potential collision."]
9389#[doc = ""]
9390#[doc = "ID: 247"]
9391#[derive(Debug, Clone, PartialEq)]
9392#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9393#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9394#[cfg_attr(feature = "ts", derive(TS))]
9395#[cfg_attr(feature = "ts", ts(export))]
9396pub struct COLLISION_DATA {
9397 #[doc = "Unique identifier, domain based on src field"]
9398 pub id: u32,
9399 #[doc = "Estimated time until collision occurs"]
9400 pub time_to_minimum_delta: f32,
9401 #[doc = "Closest vertical distance between vehicle and object"]
9402 pub altitude_minimum_delta: f32,
9403 #[doc = "Closest horizontal distance between vehicle and object"]
9404 pub horizontal_minimum_delta: f32,
9405 #[doc = "Collision data source"]
9406 pub src: MavCollisionSrc,
9407 #[doc = "Action that is being taken to avoid this collision"]
9408 pub action: MavCollisionAction,
9409 #[doc = "How concerned the aircraft is about this collision"]
9410 pub threat_level: MavCollisionThreatLevel,
9411}
9412impl COLLISION_DATA {
9413 pub const ENCODED_LEN: usize = 19usize;
9414 pub const DEFAULT: Self = Self {
9415 id: 0_u32,
9416 time_to_minimum_delta: 0.0_f32,
9417 altitude_minimum_delta: 0.0_f32,
9418 horizontal_minimum_delta: 0.0_f32,
9419 src: MavCollisionSrc::DEFAULT,
9420 action: MavCollisionAction::DEFAULT,
9421 threat_level: MavCollisionThreatLevel::DEFAULT,
9422 };
9423 #[cfg(feature = "arbitrary")]
9424 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9425 use arbitrary::{Arbitrary, Unstructured};
9426 let mut buf = [0u8; 1024];
9427 rng.fill_bytes(&mut buf);
9428 let mut unstructured = Unstructured::new(&buf);
9429 Self::arbitrary(&mut unstructured).unwrap_or_default()
9430 }
9431}
9432impl Default for COLLISION_DATA {
9433 fn default() -> Self {
9434 Self::DEFAULT.clone()
9435 }
9436}
9437impl MessageData for COLLISION_DATA {
9438 type Message = MavMessage;
9439 const ID: u32 = 247u32;
9440 const NAME: &'static str = "COLLISION";
9441 const EXTRA_CRC: u8 = 81u8;
9442 const ENCODED_LEN: usize = 19usize;
9443 fn deser(
9444 _version: MavlinkVersion,
9445 __input: &[u8],
9446 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9447 let avail_len = __input.len();
9448 let mut payload_buf = [0; Self::ENCODED_LEN];
9449 let mut buf = if avail_len < Self::ENCODED_LEN {
9450 payload_buf[0..avail_len].copy_from_slice(__input);
9451 Bytes::new(&payload_buf)
9452 } else {
9453 Bytes::new(__input)
9454 };
9455 let mut __struct = Self::default();
9456 __struct.id = buf.get_u32_le();
9457 __struct.time_to_minimum_delta = buf.get_f32_le();
9458 __struct.altitude_minimum_delta = buf.get_f32_le();
9459 __struct.horizontal_minimum_delta = buf.get_f32_le();
9460 let tmp = buf.get_u8();
9461 __struct.src =
9462 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9463 enum_type: "MavCollisionSrc",
9464 value: tmp as u32,
9465 })?;
9466 let tmp = buf.get_u8();
9467 __struct.action =
9468 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9469 enum_type: "MavCollisionAction",
9470 value: tmp as u32,
9471 })?;
9472 let tmp = buf.get_u8();
9473 __struct.threat_level =
9474 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9475 enum_type: "MavCollisionThreatLevel",
9476 value: tmp as u32,
9477 })?;
9478 Ok(__struct)
9479 }
9480 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9481 let mut __tmp = BytesMut::new(bytes);
9482 #[allow(clippy::absurd_extreme_comparisons)]
9483 #[allow(unused_comparisons)]
9484 if __tmp.remaining() < Self::ENCODED_LEN {
9485 panic!(
9486 "buffer is too small (need {} bytes, but got {})",
9487 Self::ENCODED_LEN,
9488 __tmp.remaining(),
9489 )
9490 }
9491 __tmp.put_u32_le(self.id);
9492 __tmp.put_f32_le(self.time_to_minimum_delta);
9493 __tmp.put_f32_le(self.altitude_minimum_delta);
9494 __tmp.put_f32_le(self.horizontal_minimum_delta);
9495 __tmp.put_u8(self.src as u8);
9496 __tmp.put_u8(self.action as u8);
9497 __tmp.put_u8(self.threat_level as u8);
9498 if matches!(version, MavlinkVersion::V2) {
9499 let len = __tmp.len();
9500 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9501 } else {
9502 __tmp.len()
9503 }
9504 }
9505}
9506#[doc = "Report status of a command. Includes feedback whether the command was executed. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9507#[doc = ""]
9508#[doc = "ID: 77"]
9509#[derive(Debug, Clone, PartialEq)]
9510#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9511#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9512#[cfg_attr(feature = "ts", derive(TS))]
9513#[cfg_attr(feature = "ts", ts(export))]
9514pub struct COMMAND_ACK_DATA {
9515 #[doc = "Command ID (of acknowledged command)."]
9516 pub command: MavCmd,
9517 #[doc = "Result of command."]
9518 pub result: MavResult,
9519 #[doc = "The progress percentage when result is MAV_RESULT_IN_PROGRESS. Values: [0-100], or UINT8_MAX if the progress is unknown."]
9520 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9521 pub progress: u8,
9522 #[doc = "Additional result information. Can be set with a command-specific enum containing command-specific error reasons for why the command might be denied. If used, the associated enum must be documented in the corresponding MAV_CMD (this enum should have a 0 value to indicate \"unused\" or \"unknown\")."]
9523 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9524 pub result_param2: i32,
9525 #[doc = "System ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement."]
9526 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9527 pub target_system: u8,
9528 #[doc = "Component ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement."]
9529 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9530 pub target_component: u8,
9531}
9532impl COMMAND_ACK_DATA {
9533 pub const ENCODED_LEN: usize = 10usize;
9534 pub const DEFAULT: Self = Self {
9535 command: MavCmd::DEFAULT,
9536 result: MavResult::DEFAULT,
9537 progress: 0_u8,
9538 result_param2: 0_i32,
9539 target_system: 0_u8,
9540 target_component: 0_u8,
9541 };
9542 #[cfg(feature = "arbitrary")]
9543 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9544 use arbitrary::{Arbitrary, Unstructured};
9545 let mut buf = [0u8; 1024];
9546 rng.fill_bytes(&mut buf);
9547 let mut unstructured = Unstructured::new(&buf);
9548 Self::arbitrary(&mut unstructured).unwrap_or_default()
9549 }
9550}
9551impl Default for COMMAND_ACK_DATA {
9552 fn default() -> Self {
9553 Self::DEFAULT.clone()
9554 }
9555}
9556impl MessageData for COMMAND_ACK_DATA {
9557 type Message = MavMessage;
9558 const ID: u32 = 77u32;
9559 const NAME: &'static str = "COMMAND_ACK";
9560 const EXTRA_CRC: u8 = 143u8;
9561 const ENCODED_LEN: usize = 10usize;
9562 fn deser(
9563 _version: MavlinkVersion,
9564 __input: &[u8],
9565 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9566 let avail_len = __input.len();
9567 let mut payload_buf = [0; Self::ENCODED_LEN];
9568 let mut buf = if avail_len < Self::ENCODED_LEN {
9569 payload_buf[0..avail_len].copy_from_slice(__input);
9570 Bytes::new(&payload_buf)
9571 } else {
9572 Bytes::new(__input)
9573 };
9574 let mut __struct = Self::default();
9575 let tmp = buf.get_u16_le();
9576 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9577 ::mavlink_core::error::ParserError::InvalidEnum {
9578 enum_type: "MavCmd",
9579 value: tmp as u32,
9580 },
9581 )?;
9582 let tmp = buf.get_u8();
9583 __struct.result =
9584 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9585 enum_type: "MavResult",
9586 value: tmp as u32,
9587 })?;
9588 __struct.progress = buf.get_u8();
9589 __struct.result_param2 = buf.get_i32_le();
9590 __struct.target_system = buf.get_u8();
9591 __struct.target_component = buf.get_u8();
9592 Ok(__struct)
9593 }
9594 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9595 let mut __tmp = BytesMut::new(bytes);
9596 #[allow(clippy::absurd_extreme_comparisons)]
9597 #[allow(unused_comparisons)]
9598 if __tmp.remaining() < Self::ENCODED_LEN {
9599 panic!(
9600 "buffer is too small (need {} bytes, but got {})",
9601 Self::ENCODED_LEN,
9602 __tmp.remaining(),
9603 )
9604 }
9605 __tmp.put_u16_le(self.command as u16);
9606 __tmp.put_u8(self.result as u8);
9607 if matches!(version, MavlinkVersion::V2) {
9608 __tmp.put_u8(self.progress);
9609 __tmp.put_i32_le(self.result_param2);
9610 __tmp.put_u8(self.target_system);
9611 __tmp.put_u8(self.target_component);
9612 let len = __tmp.len();
9613 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9614 } else {
9615 __tmp.len()
9616 }
9617 }
9618}
9619#[doc = "Cancel a long running command. The target system should respond with a COMMAND_ACK to the original command with result=MAV_RESULT_CANCELLED if the long running process was cancelled. If it has already completed, the cancel action can be ignored. The cancel action can be retried until some sort of acknowledgement to the original command has been received. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9620#[doc = ""]
9621#[doc = "ID: 80"]
9622#[derive(Debug, Clone, PartialEq)]
9623#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9624#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9625#[cfg_attr(feature = "ts", derive(TS))]
9626#[cfg_attr(feature = "ts", ts(export))]
9627pub struct COMMAND_CANCEL_DATA {
9628 #[doc = "Command ID (of command to cancel)."]
9629 pub command: MavCmd,
9630 #[doc = "System executing long running command. Should not be broadcast (0)."]
9631 pub target_system: u8,
9632 #[doc = "Component executing long running command."]
9633 pub target_component: u8,
9634}
9635impl COMMAND_CANCEL_DATA {
9636 pub const ENCODED_LEN: usize = 4usize;
9637 pub const DEFAULT: Self = Self {
9638 command: MavCmd::DEFAULT,
9639 target_system: 0_u8,
9640 target_component: 0_u8,
9641 };
9642 #[cfg(feature = "arbitrary")]
9643 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9644 use arbitrary::{Arbitrary, Unstructured};
9645 let mut buf = [0u8; 1024];
9646 rng.fill_bytes(&mut buf);
9647 let mut unstructured = Unstructured::new(&buf);
9648 Self::arbitrary(&mut unstructured).unwrap_or_default()
9649 }
9650}
9651impl Default for COMMAND_CANCEL_DATA {
9652 fn default() -> Self {
9653 Self::DEFAULT.clone()
9654 }
9655}
9656impl MessageData for COMMAND_CANCEL_DATA {
9657 type Message = MavMessage;
9658 const ID: u32 = 80u32;
9659 const NAME: &'static str = "COMMAND_CANCEL";
9660 const EXTRA_CRC: u8 = 14u8;
9661 const ENCODED_LEN: usize = 4usize;
9662 fn deser(
9663 _version: MavlinkVersion,
9664 __input: &[u8],
9665 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9666 let avail_len = __input.len();
9667 let mut payload_buf = [0; Self::ENCODED_LEN];
9668 let mut buf = if avail_len < Self::ENCODED_LEN {
9669 payload_buf[0..avail_len].copy_from_slice(__input);
9670 Bytes::new(&payload_buf)
9671 } else {
9672 Bytes::new(__input)
9673 };
9674 let mut __struct = Self::default();
9675 let tmp = buf.get_u16_le();
9676 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9677 ::mavlink_core::error::ParserError::InvalidEnum {
9678 enum_type: "MavCmd",
9679 value: tmp as u32,
9680 },
9681 )?;
9682 __struct.target_system = buf.get_u8();
9683 __struct.target_component = buf.get_u8();
9684 Ok(__struct)
9685 }
9686 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9687 let mut __tmp = BytesMut::new(bytes);
9688 #[allow(clippy::absurd_extreme_comparisons)]
9689 #[allow(unused_comparisons)]
9690 if __tmp.remaining() < Self::ENCODED_LEN {
9691 panic!(
9692 "buffer is too small (need {} bytes, but got {})",
9693 Self::ENCODED_LEN,
9694 __tmp.remaining(),
9695 )
9696 }
9697 __tmp.put_u16_le(self.command as u16);
9698 __tmp.put_u8(self.target_system);
9699 __tmp.put_u8(self.target_component);
9700 if matches!(version, MavlinkVersion::V2) {
9701 let len = __tmp.len();
9702 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9703 } else {
9704 __tmp.len()
9705 }
9706 }
9707}
9708#[doc = "Send a command with up to seven parameters to the MAV, where params 5 and 6 are integers and the other values are floats. This is preferred over COMMAND_LONG as it allows the MAV_FRAME to be specified for interpreting positional information, such as altitude. COMMAND_INT is also preferred when sending latitude and longitude data in params 5 and 6, as it allows for greater precision. Param 5 and 6 encode positional data as scaled integers, where the scaling depends on the actual command value. NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9709#[doc = ""]
9710#[doc = "ID: 75"]
9711#[derive(Debug, Clone, PartialEq)]
9712#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9713#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9714#[cfg_attr(feature = "ts", derive(TS))]
9715#[cfg_attr(feature = "ts", ts(export))]
9716pub struct COMMAND_INT_DATA {
9717 #[doc = "PARAM1, see MAV_CMD enum"]
9718 pub param1: f32,
9719 #[doc = "PARAM2, see MAV_CMD enum"]
9720 pub param2: f32,
9721 #[doc = "PARAM3, see MAV_CMD enum"]
9722 pub param3: f32,
9723 #[doc = "PARAM4, see MAV_CMD enum"]
9724 pub param4: f32,
9725 #[doc = "PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7"]
9726 pub x: i32,
9727 #[doc = "PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7"]
9728 pub y: i32,
9729 #[doc = "PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame)."]
9730 pub z: f32,
9731 #[doc = "The scheduled action for the mission item."]
9732 pub command: MavCmd,
9733 #[doc = "System ID"]
9734 pub target_system: u8,
9735 #[doc = "Component ID"]
9736 pub target_component: u8,
9737 #[doc = "The coordinate system of the COMMAND."]
9738 pub frame: MavFrame,
9739 #[doc = "Not used."]
9740 pub current: u8,
9741 #[doc = "Not used (set 0)."]
9742 pub autocontinue: u8,
9743}
9744impl COMMAND_INT_DATA {
9745 pub const ENCODED_LEN: usize = 35usize;
9746 pub const DEFAULT: Self = Self {
9747 param1: 0.0_f32,
9748 param2: 0.0_f32,
9749 param3: 0.0_f32,
9750 param4: 0.0_f32,
9751 x: 0_i32,
9752 y: 0_i32,
9753 z: 0.0_f32,
9754 command: MavCmd::DEFAULT,
9755 target_system: 0_u8,
9756 target_component: 0_u8,
9757 frame: MavFrame::DEFAULT,
9758 current: 0_u8,
9759 autocontinue: 0_u8,
9760 };
9761 #[cfg(feature = "arbitrary")]
9762 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9763 use arbitrary::{Arbitrary, Unstructured};
9764 let mut buf = [0u8; 1024];
9765 rng.fill_bytes(&mut buf);
9766 let mut unstructured = Unstructured::new(&buf);
9767 Self::arbitrary(&mut unstructured).unwrap_or_default()
9768 }
9769}
9770impl Default for COMMAND_INT_DATA {
9771 fn default() -> Self {
9772 Self::DEFAULT.clone()
9773 }
9774}
9775impl MessageData for COMMAND_INT_DATA {
9776 type Message = MavMessage;
9777 const ID: u32 = 75u32;
9778 const NAME: &'static str = "COMMAND_INT";
9779 const EXTRA_CRC: u8 = 158u8;
9780 const ENCODED_LEN: usize = 35usize;
9781 fn deser(
9782 _version: MavlinkVersion,
9783 __input: &[u8],
9784 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9785 let avail_len = __input.len();
9786 let mut payload_buf = [0; Self::ENCODED_LEN];
9787 let mut buf = if avail_len < Self::ENCODED_LEN {
9788 payload_buf[0..avail_len].copy_from_slice(__input);
9789 Bytes::new(&payload_buf)
9790 } else {
9791 Bytes::new(__input)
9792 };
9793 let mut __struct = Self::default();
9794 __struct.param1 = buf.get_f32_le();
9795 __struct.param2 = buf.get_f32_le();
9796 __struct.param3 = buf.get_f32_le();
9797 __struct.param4 = buf.get_f32_le();
9798 __struct.x = buf.get_i32_le();
9799 __struct.y = buf.get_i32_le();
9800 __struct.z = buf.get_f32_le();
9801 let tmp = buf.get_u16_le();
9802 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9803 ::mavlink_core::error::ParserError::InvalidEnum {
9804 enum_type: "MavCmd",
9805 value: tmp as u32,
9806 },
9807 )?;
9808 __struct.target_system = buf.get_u8();
9809 __struct.target_component = buf.get_u8();
9810 let tmp = buf.get_u8();
9811 __struct.frame =
9812 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9813 enum_type: "MavFrame",
9814 value: tmp as u32,
9815 })?;
9816 __struct.current = buf.get_u8();
9817 __struct.autocontinue = buf.get_u8();
9818 Ok(__struct)
9819 }
9820 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9821 let mut __tmp = BytesMut::new(bytes);
9822 #[allow(clippy::absurd_extreme_comparisons)]
9823 #[allow(unused_comparisons)]
9824 if __tmp.remaining() < Self::ENCODED_LEN {
9825 panic!(
9826 "buffer is too small (need {} bytes, but got {})",
9827 Self::ENCODED_LEN,
9828 __tmp.remaining(),
9829 )
9830 }
9831 __tmp.put_f32_le(self.param1);
9832 __tmp.put_f32_le(self.param2);
9833 __tmp.put_f32_le(self.param3);
9834 __tmp.put_f32_le(self.param4);
9835 __tmp.put_i32_le(self.x);
9836 __tmp.put_i32_le(self.y);
9837 __tmp.put_f32_le(self.z);
9838 __tmp.put_u16_le(self.command as u16);
9839 __tmp.put_u8(self.target_system);
9840 __tmp.put_u8(self.target_component);
9841 __tmp.put_u8(self.frame as u8);
9842 __tmp.put_u8(self.current);
9843 __tmp.put_u8(self.autocontinue);
9844 if matches!(version, MavlinkVersion::V2) {
9845 let len = __tmp.len();
9846 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9847 } else {
9848 __tmp.len()
9849 }
9850 }
9851}
9852#[doc = "Send a command with up to seven parameters to the MAV. COMMAND_INT is generally preferred when sending MAV_CMD commands that include positional information; it offers higher precision and allows the MAV_FRAME to be specified (which may otherwise be ambiguous, particularly for altitude). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9853#[doc = ""]
9854#[doc = "ID: 76"]
9855#[derive(Debug, Clone, PartialEq)]
9856#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9857#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9858#[cfg_attr(feature = "ts", derive(TS))]
9859#[cfg_attr(feature = "ts", ts(export))]
9860pub struct COMMAND_LONG_DATA {
9861 #[doc = "Parameter 1 (for the specific command)."]
9862 pub param1: f32,
9863 #[doc = "Parameter 2 (for the specific command)."]
9864 pub param2: f32,
9865 #[doc = "Parameter 3 (for the specific command)."]
9866 pub param3: f32,
9867 #[doc = "Parameter 4 (for the specific command)."]
9868 pub param4: f32,
9869 #[doc = "Parameter 5 (for the specific command)."]
9870 pub param5: f32,
9871 #[doc = "Parameter 6 (for the specific command)."]
9872 pub param6: f32,
9873 #[doc = "Parameter 7 (for the specific command)."]
9874 pub param7: f32,
9875 #[doc = "Command ID (of command to send)."]
9876 pub command: MavCmd,
9877 #[doc = "System which should execute the command"]
9878 pub target_system: u8,
9879 #[doc = "Component which should execute the command, 0 for all components"]
9880 pub target_component: u8,
9881 #[doc = "0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)"]
9882 pub confirmation: u8,
9883}
9884impl COMMAND_LONG_DATA {
9885 pub const ENCODED_LEN: usize = 33usize;
9886 pub const DEFAULT: Self = Self {
9887 param1: 0.0_f32,
9888 param2: 0.0_f32,
9889 param3: 0.0_f32,
9890 param4: 0.0_f32,
9891 param5: 0.0_f32,
9892 param6: 0.0_f32,
9893 param7: 0.0_f32,
9894 command: MavCmd::DEFAULT,
9895 target_system: 0_u8,
9896 target_component: 0_u8,
9897 confirmation: 0_u8,
9898 };
9899 #[cfg(feature = "arbitrary")]
9900 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9901 use arbitrary::{Arbitrary, Unstructured};
9902 let mut buf = [0u8; 1024];
9903 rng.fill_bytes(&mut buf);
9904 let mut unstructured = Unstructured::new(&buf);
9905 Self::arbitrary(&mut unstructured).unwrap_or_default()
9906 }
9907}
9908impl Default for COMMAND_LONG_DATA {
9909 fn default() -> Self {
9910 Self::DEFAULT.clone()
9911 }
9912}
9913impl MessageData for COMMAND_LONG_DATA {
9914 type Message = MavMessage;
9915 const ID: u32 = 76u32;
9916 const NAME: &'static str = "COMMAND_LONG";
9917 const EXTRA_CRC: u8 = 152u8;
9918 const ENCODED_LEN: usize = 33usize;
9919 fn deser(
9920 _version: MavlinkVersion,
9921 __input: &[u8],
9922 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9923 let avail_len = __input.len();
9924 let mut payload_buf = [0; Self::ENCODED_LEN];
9925 let mut buf = if avail_len < Self::ENCODED_LEN {
9926 payload_buf[0..avail_len].copy_from_slice(__input);
9927 Bytes::new(&payload_buf)
9928 } else {
9929 Bytes::new(__input)
9930 };
9931 let mut __struct = Self::default();
9932 __struct.param1 = buf.get_f32_le();
9933 __struct.param2 = buf.get_f32_le();
9934 __struct.param3 = buf.get_f32_le();
9935 __struct.param4 = buf.get_f32_le();
9936 __struct.param5 = buf.get_f32_le();
9937 __struct.param6 = buf.get_f32_le();
9938 __struct.param7 = buf.get_f32_le();
9939 let tmp = buf.get_u16_le();
9940 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9941 ::mavlink_core::error::ParserError::InvalidEnum {
9942 enum_type: "MavCmd",
9943 value: tmp as u32,
9944 },
9945 )?;
9946 __struct.target_system = buf.get_u8();
9947 __struct.target_component = buf.get_u8();
9948 __struct.confirmation = buf.get_u8();
9949 Ok(__struct)
9950 }
9951 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9952 let mut __tmp = BytesMut::new(bytes);
9953 #[allow(clippy::absurd_extreme_comparisons)]
9954 #[allow(unused_comparisons)]
9955 if __tmp.remaining() < Self::ENCODED_LEN {
9956 panic!(
9957 "buffer is too small (need {} bytes, but got {})",
9958 Self::ENCODED_LEN,
9959 __tmp.remaining(),
9960 )
9961 }
9962 __tmp.put_f32_le(self.param1);
9963 __tmp.put_f32_le(self.param2);
9964 __tmp.put_f32_le(self.param3);
9965 __tmp.put_f32_le(self.param4);
9966 __tmp.put_f32_le(self.param5);
9967 __tmp.put_f32_le(self.param6);
9968 __tmp.put_f32_le(self.param7);
9969 __tmp.put_u16_le(self.command as u16);
9970 __tmp.put_u8(self.target_system);
9971 __tmp.put_u8(self.target_component);
9972 __tmp.put_u8(self.confirmation);
9973 if matches!(version, MavlinkVersion::V2) {
9974 let len = __tmp.len();
9975 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9976 } else {
9977 __tmp.len()
9978 }
9979 }
9980}
9981#[deprecated = " See `COMPONENT_METADATA` (Deprecated since 2022-04)"]
9982#[doc = "Component information message, which may be requested using MAV_CMD_REQUEST_MESSAGE."]
9983#[doc = ""]
9984#[doc = "ID: 395"]
9985#[derive(Debug, Clone, PartialEq)]
9986#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9987#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9988#[cfg_attr(feature = "ts", derive(TS))]
9989#[cfg_attr(feature = "ts", ts(export))]
9990pub struct COMPONENT_INFORMATION_DATA {
9991 #[doc = "Timestamp (time since system boot)."]
9992 pub time_boot_ms: u32,
9993 #[doc = "CRC32 of the general metadata file (general_metadata_uri)."]
9994 pub general_metadata_file_crc: u32,
9995 #[doc = "CRC32 of peripherals metadata file (peripherals_metadata_uri)."]
9996 pub peripherals_metadata_file_crc: u32,
9997 #[doc = "MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated."]
9998 #[cfg_attr(
9999 feature = "serde",
10000 serde(
10001 serialize_with = "crate::nulstr::serialize::<_, 100>",
10002 deserialize_with = "crate::nulstr::deserialize::<_, 100>"
10003 )
10004 )]
10005 #[cfg_attr(feature = "ts", ts(type = "string"))]
10006 pub general_metadata_uri: [u8; 100],
10007 #[doc = "(Optional) MAVLink FTP URI for the peripherals metadata file (COMP_METADATA_TYPE_PERIPHERALS), which may be compressed with xz. This contains data about \"attached components\" such as UAVCAN nodes. The peripherals are in a separate file because the information must be generated dynamically at runtime. The string needs to be zero terminated."]
10008 #[cfg_attr(
10009 feature = "serde",
10010 serde(
10011 serialize_with = "crate::nulstr::serialize::<_, 100>",
10012 deserialize_with = "crate::nulstr::deserialize::<_, 100>"
10013 )
10014 )]
10015 #[cfg_attr(feature = "ts", ts(type = "string"))]
10016 pub peripherals_metadata_uri: [u8; 100],
10017}
10018impl COMPONENT_INFORMATION_DATA {
10019 pub const ENCODED_LEN: usize = 212usize;
10020 pub const DEFAULT: Self = Self {
10021 time_boot_ms: 0_u32,
10022 general_metadata_file_crc: 0_u32,
10023 peripherals_metadata_file_crc: 0_u32,
10024 general_metadata_uri: [0_u8; 100usize],
10025 peripherals_metadata_uri: [0_u8; 100usize],
10026 };
10027 #[cfg(feature = "arbitrary")]
10028 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10029 use arbitrary::{Arbitrary, Unstructured};
10030 let mut buf = [0u8; 1024];
10031 rng.fill_bytes(&mut buf);
10032 let mut unstructured = Unstructured::new(&buf);
10033 Self::arbitrary(&mut unstructured).unwrap_or_default()
10034 }
10035}
10036impl Default for COMPONENT_INFORMATION_DATA {
10037 fn default() -> Self {
10038 Self::DEFAULT.clone()
10039 }
10040}
10041impl MessageData for COMPONENT_INFORMATION_DATA {
10042 type Message = MavMessage;
10043 const ID: u32 = 395u32;
10044 const NAME: &'static str = "COMPONENT_INFORMATION";
10045 const EXTRA_CRC: u8 = 0u8;
10046 const ENCODED_LEN: usize = 212usize;
10047 fn deser(
10048 _version: MavlinkVersion,
10049 __input: &[u8],
10050 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10051 let avail_len = __input.len();
10052 let mut payload_buf = [0; Self::ENCODED_LEN];
10053 let mut buf = if avail_len < Self::ENCODED_LEN {
10054 payload_buf[0..avail_len].copy_from_slice(__input);
10055 Bytes::new(&payload_buf)
10056 } else {
10057 Bytes::new(__input)
10058 };
10059 let mut __struct = Self::default();
10060 __struct.time_boot_ms = buf.get_u32_le();
10061 __struct.general_metadata_file_crc = buf.get_u32_le();
10062 __struct.peripherals_metadata_file_crc = buf.get_u32_le();
10063 for v in &mut __struct.general_metadata_uri {
10064 let val = buf.get_u8();
10065 *v = val;
10066 }
10067 for v in &mut __struct.peripherals_metadata_uri {
10068 let val = buf.get_u8();
10069 *v = val;
10070 }
10071 Ok(__struct)
10072 }
10073 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10074 let mut __tmp = BytesMut::new(bytes);
10075 #[allow(clippy::absurd_extreme_comparisons)]
10076 #[allow(unused_comparisons)]
10077 if __tmp.remaining() < Self::ENCODED_LEN {
10078 panic!(
10079 "buffer is too small (need {} bytes, but got {})",
10080 Self::ENCODED_LEN,
10081 __tmp.remaining(),
10082 )
10083 }
10084 __tmp.put_u32_le(self.time_boot_ms);
10085 __tmp.put_u32_le(self.general_metadata_file_crc);
10086 __tmp.put_u32_le(self.peripherals_metadata_file_crc);
10087 for val in &self.general_metadata_uri {
10088 __tmp.put_u8(*val);
10089 }
10090 for val in &self.peripherals_metadata_uri {
10091 __tmp.put_u8(*val);
10092 }
10093 if matches!(version, MavlinkVersion::V2) {
10094 let len = __tmp.len();
10095 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10096 } else {
10097 __tmp.len()
10098 }
10099 }
10100}
10101#[doc = "Basic component information data. Should be requested using MAV_CMD_REQUEST_MESSAGE on startup, or when required."]
10102#[doc = ""]
10103#[doc = "ID: 396"]
10104#[derive(Debug, Clone, PartialEq)]
10105#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10106#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10107#[cfg_attr(feature = "ts", derive(TS))]
10108#[cfg_attr(feature = "ts", ts(export))]
10109pub struct COMPONENT_INFORMATION_BASIC_DATA {
10110 #[doc = "Component capability flags"]
10111 pub capabilities: MavProtocolCapability,
10112 #[doc = "Timestamp (time since system boot)."]
10113 pub time_boot_ms: u32,
10114 #[doc = "Date of manufacture as a UNIX Epoch time (since 1.1.1970) in seconds."]
10115 pub time_manufacture_s: u32,
10116 #[doc = "Name of the component vendor. Needs to be zero terminated. The field is optional and can be empty/all zeros."]
10117 #[cfg_attr(
10118 feature = "serde",
10119 serde(
10120 serialize_with = "crate::nulstr::serialize::<_, 32>",
10121 deserialize_with = "crate::nulstr::deserialize::<_, 32>"
10122 )
10123 )]
10124 #[cfg_attr(feature = "ts", ts(type = "string"))]
10125 pub vendor_name: [u8; 32],
10126 #[doc = "Name of the component model. Needs to be zero terminated. The field is optional and can be empty/all zeros."]
10127 #[cfg_attr(
10128 feature = "serde",
10129 serde(
10130 serialize_with = "crate::nulstr::serialize::<_, 32>",
10131 deserialize_with = "crate::nulstr::deserialize::<_, 32>"
10132 )
10133 )]
10134 #[cfg_attr(feature = "ts", ts(type = "string"))]
10135 pub model_name: [u8; 32],
10136 #[doc = "Software version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
10137 #[cfg_attr(
10138 feature = "serde",
10139 serde(
10140 serialize_with = "crate::nulstr::serialize::<_, 24>",
10141 deserialize_with = "crate::nulstr::deserialize::<_, 24>"
10142 )
10143 )]
10144 #[cfg_attr(feature = "ts", ts(type = "string"))]
10145 pub software_version: [u8; 24],
10146 #[doc = "Hardware version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
10147 #[cfg_attr(
10148 feature = "serde",
10149 serde(
10150 serialize_with = "crate::nulstr::serialize::<_, 24>",
10151 deserialize_with = "crate::nulstr::deserialize::<_, 24>"
10152 )
10153 )]
10154 #[cfg_attr(feature = "ts", ts(type = "string"))]
10155 pub hardware_version: [u8; 24],
10156 #[doc = "Hardware serial number. The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
10157 #[cfg_attr(
10158 feature = "serde",
10159 serde(
10160 serialize_with = "crate::nulstr::serialize::<_, 32>",
10161 deserialize_with = "crate::nulstr::deserialize::<_, 32>"
10162 )
10163 )]
10164 #[cfg_attr(feature = "ts", ts(type = "string"))]
10165 pub serial_number: [u8; 32],
10166}
10167impl COMPONENT_INFORMATION_BASIC_DATA {
10168 pub const ENCODED_LEN: usize = 160usize;
10169 pub const DEFAULT: Self = Self {
10170 capabilities: MavProtocolCapability::DEFAULT,
10171 time_boot_ms: 0_u32,
10172 time_manufacture_s: 0_u32,
10173 vendor_name: [0_u8; 32usize],
10174 model_name: [0_u8; 32usize],
10175 software_version: [0_u8; 24usize],
10176 hardware_version: [0_u8; 24usize],
10177 serial_number: [0_u8; 32usize],
10178 };
10179 #[cfg(feature = "arbitrary")]
10180 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10181 use arbitrary::{Arbitrary, Unstructured};
10182 let mut buf = [0u8; 1024];
10183 rng.fill_bytes(&mut buf);
10184 let mut unstructured = Unstructured::new(&buf);
10185 Self::arbitrary(&mut unstructured).unwrap_or_default()
10186 }
10187}
10188impl Default for COMPONENT_INFORMATION_BASIC_DATA {
10189 fn default() -> Self {
10190 Self::DEFAULT.clone()
10191 }
10192}
10193impl MessageData for COMPONENT_INFORMATION_BASIC_DATA {
10194 type Message = MavMessage;
10195 const ID: u32 = 396u32;
10196 const NAME: &'static str = "COMPONENT_INFORMATION_BASIC";
10197 const EXTRA_CRC: u8 = 50u8;
10198 const ENCODED_LEN: usize = 160usize;
10199 fn deser(
10200 _version: MavlinkVersion,
10201 __input: &[u8],
10202 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10203 let avail_len = __input.len();
10204 let mut payload_buf = [0; Self::ENCODED_LEN];
10205 let mut buf = if avail_len < Self::ENCODED_LEN {
10206 payload_buf[0..avail_len].copy_from_slice(__input);
10207 Bytes::new(&payload_buf)
10208 } else {
10209 Bytes::new(__input)
10210 };
10211 let mut __struct = Self::default();
10212 let tmp = buf.get_u64_le();
10213 __struct.capabilities = MavProtocolCapability::from_bits(
10214 tmp & MavProtocolCapability::all().bits(),
10215 )
10216 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
10217 flag_type: "MavProtocolCapability",
10218 value: tmp as u32,
10219 })?;
10220 __struct.time_boot_ms = buf.get_u32_le();
10221 __struct.time_manufacture_s = buf.get_u32_le();
10222 for v in &mut __struct.vendor_name {
10223 let val = buf.get_u8();
10224 *v = val;
10225 }
10226 for v in &mut __struct.model_name {
10227 let val = buf.get_u8();
10228 *v = val;
10229 }
10230 for v in &mut __struct.software_version {
10231 let val = buf.get_u8();
10232 *v = val;
10233 }
10234 for v in &mut __struct.hardware_version {
10235 let val = buf.get_u8();
10236 *v = val;
10237 }
10238 for v in &mut __struct.serial_number {
10239 let val = buf.get_u8();
10240 *v = val;
10241 }
10242 Ok(__struct)
10243 }
10244 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10245 let mut __tmp = BytesMut::new(bytes);
10246 #[allow(clippy::absurd_extreme_comparisons)]
10247 #[allow(unused_comparisons)]
10248 if __tmp.remaining() < Self::ENCODED_LEN {
10249 panic!(
10250 "buffer is too small (need {} bytes, but got {})",
10251 Self::ENCODED_LEN,
10252 __tmp.remaining(),
10253 )
10254 }
10255 __tmp.put_u64_le(self.capabilities.bits());
10256 __tmp.put_u32_le(self.time_boot_ms);
10257 __tmp.put_u32_le(self.time_manufacture_s);
10258 for val in &self.vendor_name {
10259 __tmp.put_u8(*val);
10260 }
10261 for val in &self.model_name {
10262 __tmp.put_u8(*val);
10263 }
10264 for val in &self.software_version {
10265 __tmp.put_u8(*val);
10266 }
10267 for val in &self.hardware_version {
10268 __tmp.put_u8(*val);
10269 }
10270 for val in &self.serial_number {
10271 __tmp.put_u8(*val);
10272 }
10273 if matches!(version, MavlinkVersion::V2) {
10274 let len = __tmp.len();
10275 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10276 } else {
10277 __tmp.len()
10278 }
10279 }
10280}
10281#[doc = "Component metadata message, which may be requested using MAV_CMD_REQUEST_MESSAGE. This contains the MAVLink FTP URI and CRC for the component's general metadata file. The file must be hosted on the component, and may be xz compressed. The file CRC can be used for file caching. The general metadata file can be read to get the locations of other metadata files (COMP_METADATA_TYPE) and translations, which may be hosted either on the vehicle or the internet. For more information see: <https://mavlink.io/en/services/component_information.html>. Note: Camera components should use CAMERA_INFORMATION instead, and autopilots may use both this message and AUTOPILOT_VERSION."]
10282#[doc = ""]
10283#[doc = "ID: 397"]
10284#[derive(Debug, Clone, PartialEq)]
10285#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10286#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10287#[cfg_attr(feature = "ts", derive(TS))]
10288#[cfg_attr(feature = "ts", ts(export))]
10289pub struct COMPONENT_METADATA_DATA {
10290 #[doc = "Timestamp (time since system boot)."]
10291 pub time_boot_ms: u32,
10292 #[doc = "CRC32 of the general metadata file."]
10293 pub file_crc: u32,
10294 #[doc = "MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated."]
10295 #[cfg_attr(
10296 feature = "serde",
10297 serde(
10298 serialize_with = "crate::nulstr::serialize::<_, 100>",
10299 deserialize_with = "crate::nulstr::deserialize::<_, 100>"
10300 )
10301 )]
10302 #[cfg_attr(feature = "ts", ts(type = "string"))]
10303 pub uri: [u8; 100],
10304}
10305impl COMPONENT_METADATA_DATA {
10306 pub const ENCODED_LEN: usize = 108usize;
10307 pub const DEFAULT: Self = Self {
10308 time_boot_ms: 0_u32,
10309 file_crc: 0_u32,
10310 uri: [0_u8; 100usize],
10311 };
10312 #[cfg(feature = "arbitrary")]
10313 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10314 use arbitrary::{Arbitrary, Unstructured};
10315 let mut buf = [0u8; 1024];
10316 rng.fill_bytes(&mut buf);
10317 let mut unstructured = Unstructured::new(&buf);
10318 Self::arbitrary(&mut unstructured).unwrap_or_default()
10319 }
10320}
10321impl Default for COMPONENT_METADATA_DATA {
10322 fn default() -> Self {
10323 Self::DEFAULT.clone()
10324 }
10325}
10326impl MessageData for COMPONENT_METADATA_DATA {
10327 type Message = MavMessage;
10328 const ID: u32 = 397u32;
10329 const NAME: &'static str = "COMPONENT_METADATA";
10330 const EXTRA_CRC: u8 = 182u8;
10331 const ENCODED_LEN: usize = 108usize;
10332 fn deser(
10333 _version: MavlinkVersion,
10334 __input: &[u8],
10335 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10336 let avail_len = __input.len();
10337 let mut payload_buf = [0; Self::ENCODED_LEN];
10338 let mut buf = if avail_len < Self::ENCODED_LEN {
10339 payload_buf[0..avail_len].copy_from_slice(__input);
10340 Bytes::new(&payload_buf)
10341 } else {
10342 Bytes::new(__input)
10343 };
10344 let mut __struct = Self::default();
10345 __struct.time_boot_ms = buf.get_u32_le();
10346 __struct.file_crc = buf.get_u32_le();
10347 for v in &mut __struct.uri {
10348 let val = buf.get_u8();
10349 *v = val;
10350 }
10351 Ok(__struct)
10352 }
10353 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10354 let mut __tmp = BytesMut::new(bytes);
10355 #[allow(clippy::absurd_extreme_comparisons)]
10356 #[allow(unused_comparisons)]
10357 if __tmp.remaining() < Self::ENCODED_LEN {
10358 panic!(
10359 "buffer is too small (need {} bytes, but got {})",
10360 Self::ENCODED_LEN,
10361 __tmp.remaining(),
10362 )
10363 }
10364 __tmp.put_u32_le(self.time_boot_ms);
10365 __tmp.put_u32_le(self.file_crc);
10366 for val in &self.uri {
10367 __tmp.put_u8(*val);
10368 }
10369 if matches!(version, MavlinkVersion::V2) {
10370 let len = __tmp.len();
10371 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10372 } else {
10373 __tmp.len()
10374 }
10375 }
10376}
10377#[doc = "The smoothed, monotonic system state used to feed the control loops of the system."]
10378#[doc = ""]
10379#[doc = "ID: 146"]
10380#[derive(Debug, Clone, PartialEq)]
10381#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10382#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10383#[cfg_attr(feature = "ts", derive(TS))]
10384#[cfg_attr(feature = "ts", ts(export))]
10385pub struct CONTROL_SYSTEM_STATE_DATA {
10386 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
10387 pub time_usec: u64,
10388 #[doc = "X acceleration in body frame"]
10389 pub x_acc: f32,
10390 #[doc = "Y acceleration in body frame"]
10391 pub y_acc: f32,
10392 #[doc = "Z acceleration in body frame"]
10393 pub z_acc: f32,
10394 #[doc = "X velocity in body frame"]
10395 pub x_vel: f32,
10396 #[doc = "Y velocity in body frame"]
10397 pub y_vel: f32,
10398 #[doc = "Z velocity in body frame"]
10399 pub z_vel: f32,
10400 #[doc = "X position in local frame"]
10401 pub x_pos: f32,
10402 #[doc = "Y position in local frame"]
10403 pub y_pos: f32,
10404 #[doc = "Z position in local frame"]
10405 pub z_pos: f32,
10406 #[doc = "Airspeed, set to -1 if unknown"]
10407 pub airspeed: f32,
10408 #[doc = "Variance of body velocity estimate"]
10409 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10410 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
10411 pub vel_variance: [f32; 3],
10412 #[doc = "Variance in local position"]
10413 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10414 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
10415 pub pos_variance: [f32; 3],
10416 #[doc = "The attitude, represented as Quaternion"]
10417 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10418 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
10419 pub q: [f32; 4],
10420 #[doc = "Angular rate in roll axis"]
10421 pub roll_rate: f32,
10422 #[doc = "Angular rate in pitch axis"]
10423 pub pitch_rate: f32,
10424 #[doc = "Angular rate in yaw axis"]
10425 pub yaw_rate: f32,
10426}
10427impl CONTROL_SYSTEM_STATE_DATA {
10428 pub const ENCODED_LEN: usize = 100usize;
10429 pub const DEFAULT: Self = Self {
10430 time_usec: 0_u64,
10431 x_acc: 0.0_f32,
10432 y_acc: 0.0_f32,
10433 z_acc: 0.0_f32,
10434 x_vel: 0.0_f32,
10435 y_vel: 0.0_f32,
10436 z_vel: 0.0_f32,
10437 x_pos: 0.0_f32,
10438 y_pos: 0.0_f32,
10439 z_pos: 0.0_f32,
10440 airspeed: 0.0_f32,
10441 vel_variance: [0.0_f32; 3usize],
10442 pos_variance: [0.0_f32; 3usize],
10443 q: [0.0_f32; 4usize],
10444 roll_rate: 0.0_f32,
10445 pitch_rate: 0.0_f32,
10446 yaw_rate: 0.0_f32,
10447 };
10448 #[cfg(feature = "arbitrary")]
10449 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10450 use arbitrary::{Arbitrary, Unstructured};
10451 let mut buf = [0u8; 1024];
10452 rng.fill_bytes(&mut buf);
10453 let mut unstructured = Unstructured::new(&buf);
10454 Self::arbitrary(&mut unstructured).unwrap_or_default()
10455 }
10456}
10457impl Default for CONTROL_SYSTEM_STATE_DATA {
10458 fn default() -> Self {
10459 Self::DEFAULT.clone()
10460 }
10461}
10462impl MessageData for CONTROL_SYSTEM_STATE_DATA {
10463 type Message = MavMessage;
10464 const ID: u32 = 146u32;
10465 const NAME: &'static str = "CONTROL_SYSTEM_STATE";
10466 const EXTRA_CRC: u8 = 103u8;
10467 const ENCODED_LEN: usize = 100usize;
10468 fn deser(
10469 _version: MavlinkVersion,
10470 __input: &[u8],
10471 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10472 let avail_len = __input.len();
10473 let mut payload_buf = [0; Self::ENCODED_LEN];
10474 let mut buf = if avail_len < Self::ENCODED_LEN {
10475 payload_buf[0..avail_len].copy_from_slice(__input);
10476 Bytes::new(&payload_buf)
10477 } else {
10478 Bytes::new(__input)
10479 };
10480 let mut __struct = Self::default();
10481 __struct.time_usec = buf.get_u64_le();
10482 __struct.x_acc = buf.get_f32_le();
10483 __struct.y_acc = buf.get_f32_le();
10484 __struct.z_acc = buf.get_f32_le();
10485 __struct.x_vel = buf.get_f32_le();
10486 __struct.y_vel = buf.get_f32_le();
10487 __struct.z_vel = buf.get_f32_le();
10488 __struct.x_pos = buf.get_f32_le();
10489 __struct.y_pos = buf.get_f32_le();
10490 __struct.z_pos = buf.get_f32_le();
10491 __struct.airspeed = buf.get_f32_le();
10492 for v in &mut __struct.vel_variance {
10493 let val = buf.get_f32_le();
10494 *v = val;
10495 }
10496 for v in &mut __struct.pos_variance {
10497 let val = buf.get_f32_le();
10498 *v = val;
10499 }
10500 for v in &mut __struct.q {
10501 let val = buf.get_f32_le();
10502 *v = val;
10503 }
10504 __struct.roll_rate = buf.get_f32_le();
10505 __struct.pitch_rate = buf.get_f32_le();
10506 __struct.yaw_rate = buf.get_f32_le();
10507 Ok(__struct)
10508 }
10509 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10510 let mut __tmp = BytesMut::new(bytes);
10511 #[allow(clippy::absurd_extreme_comparisons)]
10512 #[allow(unused_comparisons)]
10513 if __tmp.remaining() < Self::ENCODED_LEN {
10514 panic!(
10515 "buffer is too small (need {} bytes, but got {})",
10516 Self::ENCODED_LEN,
10517 __tmp.remaining(),
10518 )
10519 }
10520 __tmp.put_u64_le(self.time_usec);
10521 __tmp.put_f32_le(self.x_acc);
10522 __tmp.put_f32_le(self.y_acc);
10523 __tmp.put_f32_le(self.z_acc);
10524 __tmp.put_f32_le(self.x_vel);
10525 __tmp.put_f32_le(self.y_vel);
10526 __tmp.put_f32_le(self.z_vel);
10527 __tmp.put_f32_le(self.x_pos);
10528 __tmp.put_f32_le(self.y_pos);
10529 __tmp.put_f32_le(self.z_pos);
10530 __tmp.put_f32_le(self.airspeed);
10531 for val in &self.vel_variance {
10532 __tmp.put_f32_le(*val);
10533 }
10534 for val in &self.pos_variance {
10535 __tmp.put_f32_le(*val);
10536 }
10537 for val in &self.q {
10538 __tmp.put_f32_le(*val);
10539 }
10540 __tmp.put_f32_le(self.roll_rate);
10541 __tmp.put_f32_le(self.pitch_rate);
10542 __tmp.put_f32_le(self.yaw_rate);
10543 if matches!(version, MavlinkVersion::V2) {
10544 let len = __tmp.len();
10545 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10546 } else {
10547 __tmp.len()
10548 }
10549 }
10550}
10551#[doc = "Regular broadcast for the current latest event sequence number for a component. This is used to check for dropped events."]
10552#[doc = ""]
10553#[doc = "ID: 411"]
10554#[derive(Debug, Clone, PartialEq)]
10555#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10556#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10557#[cfg_attr(feature = "ts", derive(TS))]
10558#[cfg_attr(feature = "ts", ts(export))]
10559pub struct CURRENT_EVENT_SEQUENCE_DATA {
10560 #[doc = "Sequence number."]
10561 pub sequence: u16,
10562 #[doc = "Flag bitset."]
10563 pub flags: MavEventCurrentSequenceFlags,
10564}
10565impl CURRENT_EVENT_SEQUENCE_DATA {
10566 pub const ENCODED_LEN: usize = 3usize;
10567 pub const DEFAULT: Self = Self {
10568 sequence: 0_u16,
10569 flags: MavEventCurrentSequenceFlags::DEFAULT,
10570 };
10571 #[cfg(feature = "arbitrary")]
10572 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10573 use arbitrary::{Arbitrary, Unstructured};
10574 let mut buf = [0u8; 1024];
10575 rng.fill_bytes(&mut buf);
10576 let mut unstructured = Unstructured::new(&buf);
10577 Self::arbitrary(&mut unstructured).unwrap_or_default()
10578 }
10579}
10580impl Default for CURRENT_EVENT_SEQUENCE_DATA {
10581 fn default() -> Self {
10582 Self::DEFAULT.clone()
10583 }
10584}
10585impl MessageData for CURRENT_EVENT_SEQUENCE_DATA {
10586 type Message = MavMessage;
10587 const ID: u32 = 411u32;
10588 const NAME: &'static str = "CURRENT_EVENT_SEQUENCE";
10589 const EXTRA_CRC: u8 = 106u8;
10590 const ENCODED_LEN: usize = 3usize;
10591 fn deser(
10592 _version: MavlinkVersion,
10593 __input: &[u8],
10594 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10595 let avail_len = __input.len();
10596 let mut payload_buf = [0; Self::ENCODED_LEN];
10597 let mut buf = if avail_len < Self::ENCODED_LEN {
10598 payload_buf[0..avail_len].copy_from_slice(__input);
10599 Bytes::new(&payload_buf)
10600 } else {
10601 Bytes::new(__input)
10602 };
10603 let mut __struct = Self::default();
10604 __struct.sequence = buf.get_u16_le();
10605 let tmp = buf.get_u8();
10606 __struct.flags =
10607 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10608 enum_type: "MavEventCurrentSequenceFlags",
10609 value: tmp as u32,
10610 })?;
10611 Ok(__struct)
10612 }
10613 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10614 let mut __tmp = BytesMut::new(bytes);
10615 #[allow(clippy::absurd_extreme_comparisons)]
10616 #[allow(unused_comparisons)]
10617 if __tmp.remaining() < Self::ENCODED_LEN {
10618 panic!(
10619 "buffer is too small (need {} bytes, but got {})",
10620 Self::ENCODED_LEN,
10621 __tmp.remaining(),
10622 )
10623 }
10624 __tmp.put_u16_le(self.sequence);
10625 __tmp.put_u8(self.flags as u8);
10626 if matches!(version, MavlinkVersion::V2) {
10627 let len = __tmp.len();
10628 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10629 } else {
10630 __tmp.len()
10631 }
10632 }
10633}
10634#[doc = "Get the current mode. This should be emitted on any mode change, and broadcast at low rate (nominally 0.5 Hz). It may be requested using MAV_CMD_REQUEST_MESSAGE. See <https://mavlink.io/en/services/standard_modes.html>."]
10635#[doc = ""]
10636#[doc = "ID: 436"]
10637#[derive(Debug, Clone, PartialEq)]
10638#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10639#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10640#[cfg_attr(feature = "ts", derive(TS))]
10641#[cfg_attr(feature = "ts", ts(export))]
10642pub struct CURRENT_MODE_DATA {
10643 #[doc = "A bitfield for use for autopilot-specific flags"]
10644 pub custom_mode: u32,
10645 #[doc = "The custom_mode of the mode that was last commanded by the user (for example, with MAV_CMD_DO_SET_STANDARD_MODE, MAV_CMD_DO_SET_MODE or via RC). This should usually be the same as custom_mode. It will be different if the vehicle is unable to enter the intended mode, or has left that mode due to a failsafe condition. 0 indicates the intended custom mode is unknown/not supplied"]
10646 pub intended_custom_mode: u32,
10647 #[doc = "Standard mode."]
10648 pub standard_mode: MavStandardMode,
10649}
10650impl CURRENT_MODE_DATA {
10651 pub const ENCODED_LEN: usize = 9usize;
10652 pub const DEFAULT: Self = Self {
10653 custom_mode: 0_u32,
10654 intended_custom_mode: 0_u32,
10655 standard_mode: MavStandardMode::DEFAULT,
10656 };
10657 #[cfg(feature = "arbitrary")]
10658 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10659 use arbitrary::{Arbitrary, Unstructured};
10660 let mut buf = [0u8; 1024];
10661 rng.fill_bytes(&mut buf);
10662 let mut unstructured = Unstructured::new(&buf);
10663 Self::arbitrary(&mut unstructured).unwrap_or_default()
10664 }
10665}
10666impl Default for CURRENT_MODE_DATA {
10667 fn default() -> Self {
10668 Self::DEFAULT.clone()
10669 }
10670}
10671impl MessageData for CURRENT_MODE_DATA {
10672 type Message = MavMessage;
10673 const ID: u32 = 436u32;
10674 const NAME: &'static str = "CURRENT_MODE";
10675 const EXTRA_CRC: u8 = 193u8;
10676 const ENCODED_LEN: usize = 9usize;
10677 fn deser(
10678 _version: MavlinkVersion,
10679 __input: &[u8],
10680 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10681 let avail_len = __input.len();
10682 let mut payload_buf = [0; Self::ENCODED_LEN];
10683 let mut buf = if avail_len < Self::ENCODED_LEN {
10684 payload_buf[0..avail_len].copy_from_slice(__input);
10685 Bytes::new(&payload_buf)
10686 } else {
10687 Bytes::new(__input)
10688 };
10689 let mut __struct = Self::default();
10690 __struct.custom_mode = buf.get_u32_le();
10691 __struct.intended_custom_mode = buf.get_u32_le();
10692 let tmp = buf.get_u8();
10693 __struct.standard_mode =
10694 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10695 enum_type: "MavStandardMode",
10696 value: tmp as u32,
10697 })?;
10698 Ok(__struct)
10699 }
10700 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10701 let mut __tmp = BytesMut::new(bytes);
10702 #[allow(clippy::absurd_extreme_comparisons)]
10703 #[allow(unused_comparisons)]
10704 if __tmp.remaining() < Self::ENCODED_LEN {
10705 panic!(
10706 "buffer is too small (need {} bytes, but got {})",
10707 Self::ENCODED_LEN,
10708 __tmp.remaining(),
10709 )
10710 }
10711 __tmp.put_u32_le(self.custom_mode);
10712 __tmp.put_u32_le(self.intended_custom_mode);
10713 __tmp.put_u8(self.standard_mode as u8);
10714 if matches!(version, MavlinkVersion::V2) {
10715 let len = __tmp.len();
10716 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10717 } else {
10718 __tmp.len()
10719 }
10720 }
10721}
10722#[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-08)"]
10723#[doc = "Data stream status information."]
10724#[doc = ""]
10725#[doc = "ID: 67"]
10726#[derive(Debug, Clone, PartialEq)]
10727#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10728#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10729#[cfg_attr(feature = "ts", derive(TS))]
10730#[cfg_attr(feature = "ts", ts(export))]
10731pub struct DATA_STREAM_DATA {
10732 #[doc = "The message rate"]
10733 pub message_rate: u16,
10734 #[doc = "The ID of the requested data stream"]
10735 pub stream_id: u8,
10736 #[doc = "1 stream is enabled, 0 stream is stopped."]
10737 pub on_off: u8,
10738}
10739impl DATA_STREAM_DATA {
10740 pub const ENCODED_LEN: usize = 4usize;
10741 pub const DEFAULT: Self = Self {
10742 message_rate: 0_u16,
10743 stream_id: 0_u8,
10744 on_off: 0_u8,
10745 };
10746 #[cfg(feature = "arbitrary")]
10747 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10748 use arbitrary::{Arbitrary, Unstructured};
10749 let mut buf = [0u8; 1024];
10750 rng.fill_bytes(&mut buf);
10751 let mut unstructured = Unstructured::new(&buf);
10752 Self::arbitrary(&mut unstructured).unwrap_or_default()
10753 }
10754}
10755impl Default for DATA_STREAM_DATA {
10756 fn default() -> Self {
10757 Self::DEFAULT.clone()
10758 }
10759}
10760impl MessageData for DATA_STREAM_DATA {
10761 type Message = MavMessage;
10762 const ID: u32 = 67u32;
10763 const NAME: &'static str = "DATA_STREAM";
10764 const EXTRA_CRC: u8 = 21u8;
10765 const ENCODED_LEN: usize = 4usize;
10766 fn deser(
10767 _version: MavlinkVersion,
10768 __input: &[u8],
10769 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10770 let avail_len = __input.len();
10771 let mut payload_buf = [0; Self::ENCODED_LEN];
10772 let mut buf = if avail_len < Self::ENCODED_LEN {
10773 payload_buf[0..avail_len].copy_from_slice(__input);
10774 Bytes::new(&payload_buf)
10775 } else {
10776 Bytes::new(__input)
10777 };
10778 let mut __struct = Self::default();
10779 __struct.message_rate = buf.get_u16_le();
10780 __struct.stream_id = buf.get_u8();
10781 __struct.on_off = buf.get_u8();
10782 Ok(__struct)
10783 }
10784 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10785 let mut __tmp = BytesMut::new(bytes);
10786 #[allow(clippy::absurd_extreme_comparisons)]
10787 #[allow(unused_comparisons)]
10788 if __tmp.remaining() < Self::ENCODED_LEN {
10789 panic!(
10790 "buffer is too small (need {} bytes, but got {})",
10791 Self::ENCODED_LEN,
10792 __tmp.remaining(),
10793 )
10794 }
10795 __tmp.put_u16_le(self.message_rate);
10796 __tmp.put_u8(self.stream_id);
10797 __tmp.put_u8(self.on_off);
10798 if matches!(version, MavlinkVersion::V2) {
10799 let len = __tmp.len();
10800 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10801 } else {
10802 __tmp.len()
10803 }
10804 }
10805}
10806#[doc = "Handshake message to initiate, control and stop image streaming when using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
10807#[doc = ""]
10808#[doc = "ID: 130"]
10809#[derive(Debug, Clone, PartialEq)]
10810#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10811#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10812#[cfg_attr(feature = "ts", derive(TS))]
10813#[cfg_attr(feature = "ts", ts(export))]
10814pub struct DATA_TRANSMISSION_HANDSHAKE_DATA {
10815 #[doc = "total data size (set on ACK only)."]
10816 pub size: u32,
10817 #[doc = "Width of a matrix or image."]
10818 pub width: u16,
10819 #[doc = "Height of a matrix or image."]
10820 pub height: u16,
10821 #[doc = "Number of packets being sent (set on ACK only)."]
10822 pub packets: u16,
10823 #[doc = "Type of requested/acknowledged data."]
10824 pub mavtype: MavlinkDataStreamType,
10825 #[doc = "Payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only)."]
10826 pub payload: u8,
10827 #[doc = "JPEG quality. Values: [1-100]."]
10828 pub jpg_quality: u8,
10829}
10830impl DATA_TRANSMISSION_HANDSHAKE_DATA {
10831 pub const ENCODED_LEN: usize = 13usize;
10832 pub const DEFAULT: Self = Self {
10833 size: 0_u32,
10834 width: 0_u16,
10835 height: 0_u16,
10836 packets: 0_u16,
10837 mavtype: MavlinkDataStreamType::DEFAULT,
10838 payload: 0_u8,
10839 jpg_quality: 0_u8,
10840 };
10841 #[cfg(feature = "arbitrary")]
10842 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10843 use arbitrary::{Arbitrary, Unstructured};
10844 let mut buf = [0u8; 1024];
10845 rng.fill_bytes(&mut buf);
10846 let mut unstructured = Unstructured::new(&buf);
10847 Self::arbitrary(&mut unstructured).unwrap_or_default()
10848 }
10849}
10850impl Default for DATA_TRANSMISSION_HANDSHAKE_DATA {
10851 fn default() -> Self {
10852 Self::DEFAULT.clone()
10853 }
10854}
10855impl MessageData for DATA_TRANSMISSION_HANDSHAKE_DATA {
10856 type Message = MavMessage;
10857 const ID: u32 = 130u32;
10858 const NAME: &'static str = "DATA_TRANSMISSION_HANDSHAKE";
10859 const EXTRA_CRC: u8 = 29u8;
10860 const ENCODED_LEN: usize = 13usize;
10861 fn deser(
10862 _version: MavlinkVersion,
10863 __input: &[u8],
10864 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10865 let avail_len = __input.len();
10866 let mut payload_buf = [0; Self::ENCODED_LEN];
10867 let mut buf = if avail_len < Self::ENCODED_LEN {
10868 payload_buf[0..avail_len].copy_from_slice(__input);
10869 Bytes::new(&payload_buf)
10870 } else {
10871 Bytes::new(__input)
10872 };
10873 let mut __struct = Self::default();
10874 __struct.size = buf.get_u32_le();
10875 __struct.width = buf.get_u16_le();
10876 __struct.height = buf.get_u16_le();
10877 __struct.packets = buf.get_u16_le();
10878 let tmp = buf.get_u8();
10879 __struct.mavtype =
10880 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10881 enum_type: "MavlinkDataStreamType",
10882 value: tmp as u32,
10883 })?;
10884 __struct.payload = buf.get_u8();
10885 __struct.jpg_quality = buf.get_u8();
10886 Ok(__struct)
10887 }
10888 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10889 let mut __tmp = BytesMut::new(bytes);
10890 #[allow(clippy::absurd_extreme_comparisons)]
10891 #[allow(unused_comparisons)]
10892 if __tmp.remaining() < Self::ENCODED_LEN {
10893 panic!(
10894 "buffer is too small (need {} bytes, but got {})",
10895 Self::ENCODED_LEN,
10896 __tmp.remaining(),
10897 )
10898 }
10899 __tmp.put_u32_le(self.size);
10900 __tmp.put_u16_le(self.width);
10901 __tmp.put_u16_le(self.height);
10902 __tmp.put_u16_le(self.packets);
10903 __tmp.put_u8(self.mavtype as u8);
10904 __tmp.put_u8(self.payload);
10905 __tmp.put_u8(self.jpg_quality);
10906 if matches!(version, MavlinkVersion::V2) {
10907 let len = __tmp.len();
10908 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10909 } else {
10910 __tmp.len()
10911 }
10912 }
10913}
10914#[doc = "Send a debug value. The index is used to discriminate between values. These values show up in the plot of QGroundControl as DEBUG N."]
10915#[doc = ""]
10916#[doc = "ID: 254"]
10917#[derive(Debug, Clone, PartialEq)]
10918#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10919#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10920#[cfg_attr(feature = "ts", derive(TS))]
10921#[cfg_attr(feature = "ts", ts(export))]
10922pub struct DEBUG_DATA {
10923 #[doc = "Timestamp (time since system boot)."]
10924 pub time_boot_ms: u32,
10925 #[doc = "DEBUG value"]
10926 pub value: f32,
10927 #[doc = "index of debug variable"]
10928 pub ind: u8,
10929}
10930impl DEBUG_DATA {
10931 pub const ENCODED_LEN: usize = 9usize;
10932 pub const DEFAULT: Self = Self {
10933 time_boot_ms: 0_u32,
10934 value: 0.0_f32,
10935 ind: 0_u8,
10936 };
10937 #[cfg(feature = "arbitrary")]
10938 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10939 use arbitrary::{Arbitrary, Unstructured};
10940 let mut buf = [0u8; 1024];
10941 rng.fill_bytes(&mut buf);
10942 let mut unstructured = Unstructured::new(&buf);
10943 Self::arbitrary(&mut unstructured).unwrap_or_default()
10944 }
10945}
10946impl Default for DEBUG_DATA {
10947 fn default() -> Self {
10948 Self::DEFAULT.clone()
10949 }
10950}
10951impl MessageData for DEBUG_DATA {
10952 type Message = MavMessage;
10953 const ID: u32 = 254u32;
10954 const NAME: &'static str = "DEBUG";
10955 const EXTRA_CRC: u8 = 46u8;
10956 const ENCODED_LEN: usize = 9usize;
10957 fn deser(
10958 _version: MavlinkVersion,
10959 __input: &[u8],
10960 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10961 let avail_len = __input.len();
10962 let mut payload_buf = [0; Self::ENCODED_LEN];
10963 let mut buf = if avail_len < Self::ENCODED_LEN {
10964 payload_buf[0..avail_len].copy_from_slice(__input);
10965 Bytes::new(&payload_buf)
10966 } else {
10967 Bytes::new(__input)
10968 };
10969 let mut __struct = Self::default();
10970 __struct.time_boot_ms = buf.get_u32_le();
10971 __struct.value = buf.get_f32_le();
10972 __struct.ind = buf.get_u8();
10973 Ok(__struct)
10974 }
10975 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10976 let mut __tmp = BytesMut::new(bytes);
10977 #[allow(clippy::absurd_extreme_comparisons)]
10978 #[allow(unused_comparisons)]
10979 if __tmp.remaining() < Self::ENCODED_LEN {
10980 panic!(
10981 "buffer is too small (need {} bytes, but got {})",
10982 Self::ENCODED_LEN,
10983 __tmp.remaining(),
10984 )
10985 }
10986 __tmp.put_u32_le(self.time_boot_ms);
10987 __tmp.put_f32_le(self.value);
10988 __tmp.put_u8(self.ind);
10989 if matches!(version, MavlinkVersion::V2) {
10990 let len = __tmp.len();
10991 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10992 } else {
10993 __tmp.len()
10994 }
10995 }
10996}
10997#[doc = "Large debug/prototyping array. The message uses the maximum available payload for data. The array_id and name fields are used to discriminate between messages in code and in user interfaces (respectively). Do not use in production code."]
10998#[doc = ""]
10999#[doc = "ID: 350"]
11000#[derive(Debug, Clone, PartialEq)]
11001#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11002#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11003#[cfg_attr(feature = "ts", derive(TS))]
11004#[cfg_attr(feature = "ts", ts(export))]
11005pub struct DEBUG_FLOAT_ARRAY_DATA {
11006 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
11007 pub time_usec: u64,
11008 #[doc = "Unique ID used to discriminate between arrays"]
11009 pub array_id: u16,
11010 #[doc = "Name, for human-friendly display in a Ground Control Station"]
11011 #[cfg_attr(
11012 feature = "serde",
11013 serde(
11014 serialize_with = "crate::nulstr::serialize::<_, 10>",
11015 deserialize_with = "crate::nulstr::deserialize::<_, 10>"
11016 )
11017 )]
11018 #[cfg_attr(feature = "ts", ts(type = "string"))]
11019 pub name: [u8; 10],
11020 #[doc = "data"]
11021 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11022 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11023 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11024 pub data: [f32; 58],
11025}
11026impl DEBUG_FLOAT_ARRAY_DATA {
11027 pub const ENCODED_LEN: usize = 252usize;
11028 pub const DEFAULT: Self = Self {
11029 time_usec: 0_u64,
11030 array_id: 0_u16,
11031 name: [0_u8; 10usize],
11032 data: [0.0_f32; 58usize],
11033 };
11034 #[cfg(feature = "arbitrary")]
11035 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11036 use arbitrary::{Arbitrary, Unstructured};
11037 let mut buf = [0u8; 1024];
11038 rng.fill_bytes(&mut buf);
11039 let mut unstructured = Unstructured::new(&buf);
11040 Self::arbitrary(&mut unstructured).unwrap_or_default()
11041 }
11042}
11043impl Default for DEBUG_FLOAT_ARRAY_DATA {
11044 fn default() -> Self {
11045 Self::DEFAULT.clone()
11046 }
11047}
11048impl MessageData for DEBUG_FLOAT_ARRAY_DATA {
11049 type Message = MavMessage;
11050 const ID: u32 = 350u32;
11051 const NAME: &'static str = "DEBUG_FLOAT_ARRAY";
11052 const EXTRA_CRC: u8 = 232u8;
11053 const ENCODED_LEN: usize = 252usize;
11054 fn deser(
11055 _version: MavlinkVersion,
11056 __input: &[u8],
11057 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11058 let avail_len = __input.len();
11059 let mut payload_buf = [0; Self::ENCODED_LEN];
11060 let mut buf = if avail_len < Self::ENCODED_LEN {
11061 payload_buf[0..avail_len].copy_from_slice(__input);
11062 Bytes::new(&payload_buf)
11063 } else {
11064 Bytes::new(__input)
11065 };
11066 let mut __struct = Self::default();
11067 __struct.time_usec = buf.get_u64_le();
11068 __struct.array_id = buf.get_u16_le();
11069 for v in &mut __struct.name {
11070 let val = buf.get_u8();
11071 *v = val;
11072 }
11073 for v in &mut __struct.data {
11074 let val = buf.get_f32_le();
11075 *v = val;
11076 }
11077 Ok(__struct)
11078 }
11079 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11080 let mut __tmp = BytesMut::new(bytes);
11081 #[allow(clippy::absurd_extreme_comparisons)]
11082 #[allow(unused_comparisons)]
11083 if __tmp.remaining() < Self::ENCODED_LEN {
11084 panic!(
11085 "buffer is too small (need {} bytes, but got {})",
11086 Self::ENCODED_LEN,
11087 __tmp.remaining(),
11088 )
11089 }
11090 __tmp.put_u64_le(self.time_usec);
11091 __tmp.put_u16_le(self.array_id);
11092 for val in &self.name {
11093 __tmp.put_u8(*val);
11094 }
11095 if matches!(version, MavlinkVersion::V2) {
11096 for val in &self.data {
11097 __tmp.put_f32_le(*val);
11098 }
11099 let len = __tmp.len();
11100 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11101 } else {
11102 __tmp.len()
11103 }
11104 }
11105}
11106#[doc = "To debug something using a named 3D vector."]
11107#[doc = ""]
11108#[doc = "ID: 250"]
11109#[derive(Debug, Clone, PartialEq)]
11110#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11111#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11112#[cfg_attr(feature = "ts", derive(TS))]
11113#[cfg_attr(feature = "ts", ts(export))]
11114pub struct DEBUG_VECT_DATA {
11115 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
11116 pub time_usec: u64,
11117 #[doc = "x"]
11118 pub x: f32,
11119 #[doc = "y"]
11120 pub y: f32,
11121 #[doc = "z"]
11122 pub z: f32,
11123 #[doc = "Name"]
11124 #[cfg_attr(
11125 feature = "serde",
11126 serde(
11127 serialize_with = "crate::nulstr::serialize::<_, 10>",
11128 deserialize_with = "crate::nulstr::deserialize::<_, 10>"
11129 )
11130 )]
11131 #[cfg_attr(feature = "ts", ts(type = "string"))]
11132 pub name: [u8; 10],
11133}
11134impl DEBUG_VECT_DATA {
11135 pub const ENCODED_LEN: usize = 30usize;
11136 pub const DEFAULT: Self = Self {
11137 time_usec: 0_u64,
11138 x: 0.0_f32,
11139 y: 0.0_f32,
11140 z: 0.0_f32,
11141 name: [0_u8; 10usize],
11142 };
11143 #[cfg(feature = "arbitrary")]
11144 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11145 use arbitrary::{Arbitrary, Unstructured};
11146 let mut buf = [0u8; 1024];
11147 rng.fill_bytes(&mut buf);
11148 let mut unstructured = Unstructured::new(&buf);
11149 Self::arbitrary(&mut unstructured).unwrap_or_default()
11150 }
11151}
11152impl Default for DEBUG_VECT_DATA {
11153 fn default() -> Self {
11154 Self::DEFAULT.clone()
11155 }
11156}
11157impl MessageData for DEBUG_VECT_DATA {
11158 type Message = MavMessage;
11159 const ID: u32 = 250u32;
11160 const NAME: &'static str = "DEBUG_VECT";
11161 const EXTRA_CRC: u8 = 49u8;
11162 const ENCODED_LEN: usize = 30usize;
11163 fn deser(
11164 _version: MavlinkVersion,
11165 __input: &[u8],
11166 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11167 let avail_len = __input.len();
11168 let mut payload_buf = [0; Self::ENCODED_LEN];
11169 let mut buf = if avail_len < Self::ENCODED_LEN {
11170 payload_buf[0..avail_len].copy_from_slice(__input);
11171 Bytes::new(&payload_buf)
11172 } else {
11173 Bytes::new(__input)
11174 };
11175 let mut __struct = Self::default();
11176 __struct.time_usec = buf.get_u64_le();
11177 __struct.x = buf.get_f32_le();
11178 __struct.y = buf.get_f32_le();
11179 __struct.z = buf.get_f32_le();
11180 for v in &mut __struct.name {
11181 let val = buf.get_u8();
11182 *v = val;
11183 }
11184 Ok(__struct)
11185 }
11186 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11187 let mut __tmp = BytesMut::new(bytes);
11188 #[allow(clippy::absurd_extreme_comparisons)]
11189 #[allow(unused_comparisons)]
11190 if __tmp.remaining() < Self::ENCODED_LEN {
11191 panic!(
11192 "buffer is too small (need {} bytes, but got {})",
11193 Self::ENCODED_LEN,
11194 __tmp.remaining(),
11195 )
11196 }
11197 __tmp.put_u64_le(self.time_usec);
11198 __tmp.put_f32_le(self.x);
11199 __tmp.put_f32_le(self.y);
11200 __tmp.put_f32_le(self.z);
11201 for val in &self.name {
11202 __tmp.put_u8(*val);
11203 }
11204 if matches!(version, MavlinkVersion::V2) {
11205 let len = __tmp.len();
11206 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11207 } else {
11208 __tmp.len()
11209 }
11210 }
11211}
11212#[doc = "Distance sensor information for an onboard rangefinder."]
11213#[doc = ""]
11214#[doc = "ID: 132"]
11215#[derive(Debug, Clone, PartialEq)]
11216#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11217#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11218#[cfg_attr(feature = "ts", derive(TS))]
11219#[cfg_attr(feature = "ts", ts(export))]
11220pub struct DISTANCE_SENSOR_DATA {
11221 #[doc = "Timestamp (time since system boot)."]
11222 pub time_boot_ms: u32,
11223 #[doc = "Minimum distance the sensor can measure"]
11224 pub min_distance: u16,
11225 #[doc = "Maximum distance the sensor can measure"]
11226 pub max_distance: u16,
11227 #[doc = "Current distance reading"]
11228 pub current_distance: u16,
11229 #[doc = "Type of distance sensor."]
11230 pub mavtype: MavDistanceSensor,
11231 #[doc = "Onboard ID of the sensor"]
11232 pub id: u8,
11233 #[doc = "Direction the sensor faces. downward-facing: ROTATION_PITCH_270, upward-facing: ROTATION_PITCH_90, backward-facing: ROTATION_PITCH_180, forward-facing: ROTATION_NONE, left-facing: ROTATION_YAW_90, right-facing: ROTATION_YAW_270"]
11234 pub orientation: MavSensorOrientation,
11235 #[doc = "Measurement variance. Max standard deviation is 6cm. UINT8_MAX if unknown."]
11236 pub covariance: u8,
11237 #[doc = "Horizontal Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0."]
11238 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11239 pub horizontal_fov: f32,
11240 #[doc = "Vertical Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0."]
11241 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11242 pub vertical_fov: f32,
11243 #[doc = "Quaternion of the sensor orientation in vehicle body frame (w, x, y, z order, zero-rotation is 1, 0, 0, 0). Zero-rotation is along the vehicle body x-axis. This field is required if the orientation is set to MAV_SENSOR_ROTATION_CUSTOM. Set it to 0 if invalid.\""]
11244 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11245 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11246 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11247 pub quaternion: [f32; 4],
11248 #[doc = "Signal quality of the sensor. Specific to each sensor type, representing the relation of the signal strength with the target reflectivity, distance, size or aspect, but normalised as a percentage. 0 = unknown/unset signal quality, 1 = invalid signal, 100 = perfect signal."]
11249 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11250 pub signal_quality: u8,
11251}
11252impl DISTANCE_SENSOR_DATA {
11253 pub const ENCODED_LEN: usize = 39usize;
11254 pub const DEFAULT: Self = Self {
11255 time_boot_ms: 0_u32,
11256 min_distance: 0_u16,
11257 max_distance: 0_u16,
11258 current_distance: 0_u16,
11259 mavtype: MavDistanceSensor::DEFAULT,
11260 id: 0_u8,
11261 orientation: MavSensorOrientation::DEFAULT,
11262 covariance: 0_u8,
11263 horizontal_fov: 0.0_f32,
11264 vertical_fov: 0.0_f32,
11265 quaternion: [0.0_f32; 4usize],
11266 signal_quality: 0_u8,
11267 };
11268 #[cfg(feature = "arbitrary")]
11269 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11270 use arbitrary::{Arbitrary, Unstructured};
11271 let mut buf = [0u8; 1024];
11272 rng.fill_bytes(&mut buf);
11273 let mut unstructured = Unstructured::new(&buf);
11274 Self::arbitrary(&mut unstructured).unwrap_or_default()
11275 }
11276}
11277impl Default for DISTANCE_SENSOR_DATA {
11278 fn default() -> Self {
11279 Self::DEFAULT.clone()
11280 }
11281}
11282impl MessageData for DISTANCE_SENSOR_DATA {
11283 type Message = MavMessage;
11284 const ID: u32 = 132u32;
11285 const NAME: &'static str = "DISTANCE_SENSOR";
11286 const EXTRA_CRC: u8 = 85u8;
11287 const ENCODED_LEN: usize = 39usize;
11288 fn deser(
11289 _version: MavlinkVersion,
11290 __input: &[u8],
11291 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11292 let avail_len = __input.len();
11293 let mut payload_buf = [0; Self::ENCODED_LEN];
11294 let mut buf = if avail_len < Self::ENCODED_LEN {
11295 payload_buf[0..avail_len].copy_from_slice(__input);
11296 Bytes::new(&payload_buf)
11297 } else {
11298 Bytes::new(__input)
11299 };
11300 let mut __struct = Self::default();
11301 __struct.time_boot_ms = buf.get_u32_le();
11302 __struct.min_distance = buf.get_u16_le();
11303 __struct.max_distance = buf.get_u16_le();
11304 __struct.current_distance = buf.get_u16_le();
11305 let tmp = buf.get_u8();
11306 __struct.mavtype =
11307 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11308 enum_type: "MavDistanceSensor",
11309 value: tmp as u32,
11310 })?;
11311 __struct.id = buf.get_u8();
11312 let tmp = buf.get_u8();
11313 __struct.orientation =
11314 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11315 enum_type: "MavSensorOrientation",
11316 value: tmp as u32,
11317 })?;
11318 __struct.covariance = buf.get_u8();
11319 __struct.horizontal_fov = buf.get_f32_le();
11320 __struct.vertical_fov = buf.get_f32_le();
11321 for v in &mut __struct.quaternion {
11322 let val = buf.get_f32_le();
11323 *v = val;
11324 }
11325 __struct.signal_quality = buf.get_u8();
11326 Ok(__struct)
11327 }
11328 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11329 let mut __tmp = BytesMut::new(bytes);
11330 #[allow(clippy::absurd_extreme_comparisons)]
11331 #[allow(unused_comparisons)]
11332 if __tmp.remaining() < Self::ENCODED_LEN {
11333 panic!(
11334 "buffer is too small (need {} bytes, but got {})",
11335 Self::ENCODED_LEN,
11336 __tmp.remaining(),
11337 )
11338 }
11339 __tmp.put_u32_le(self.time_boot_ms);
11340 __tmp.put_u16_le(self.min_distance);
11341 __tmp.put_u16_le(self.max_distance);
11342 __tmp.put_u16_le(self.current_distance);
11343 __tmp.put_u8(self.mavtype as u8);
11344 __tmp.put_u8(self.id);
11345 __tmp.put_u8(self.orientation as u8);
11346 __tmp.put_u8(self.covariance);
11347 if matches!(version, MavlinkVersion::V2) {
11348 __tmp.put_f32_le(self.horizontal_fov);
11349 __tmp.put_f32_le(self.vertical_fov);
11350 for val in &self.quaternion {
11351 __tmp.put_f32_le(*val);
11352 }
11353 __tmp.put_u8(self.signal_quality);
11354 let len = __tmp.len();
11355 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11356 } else {
11357 __tmp.len()
11358 }
11359 }
11360}
11361#[doc = "EFI status output."]
11362#[doc = ""]
11363#[doc = "ID: 225"]
11364#[derive(Debug, Clone, PartialEq)]
11365#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11366#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11367#[cfg_attr(feature = "ts", derive(TS))]
11368#[cfg_attr(feature = "ts", ts(export))]
11369pub struct EFI_STATUS_DATA {
11370 #[doc = "ECU index"]
11371 pub ecu_index: f32,
11372 #[doc = "RPM"]
11373 pub rpm: f32,
11374 #[doc = "Fuel consumed"]
11375 pub fuel_consumed: f32,
11376 #[doc = "Fuel flow rate"]
11377 pub fuel_flow: f32,
11378 #[doc = "Engine load"]
11379 pub engine_load: f32,
11380 #[doc = "Throttle position"]
11381 pub throttle_position: f32,
11382 #[doc = "Spark dwell time"]
11383 pub spark_dwell_time: f32,
11384 #[doc = "Barometric pressure"]
11385 pub barometric_pressure: f32,
11386 #[doc = "Intake manifold pressure("]
11387 pub intake_manifold_pressure: f32,
11388 #[doc = "Intake manifold temperature"]
11389 pub intake_manifold_temperature: f32,
11390 #[doc = "Cylinder head temperature"]
11391 pub cylinder_head_temperature: f32,
11392 #[doc = "Ignition timing (Crank angle degrees)"]
11393 pub ignition_timing: f32,
11394 #[doc = "Injection time"]
11395 pub injection_time: f32,
11396 #[doc = "Exhaust gas temperature"]
11397 pub exhaust_gas_temperature: f32,
11398 #[doc = "Output throttle"]
11399 pub throttle_out: f32,
11400 #[doc = "Pressure/temperature compensation"]
11401 pub pt_compensation: f32,
11402 #[doc = "EFI health status"]
11403 pub health: u8,
11404 #[doc = "Supply voltage to EFI sparking system. Zero in this value means \"unknown\", so if the supply voltage really is zero volts use 0.0001 instead."]
11405 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11406 pub ignition_voltage: f32,
11407 #[doc = "Fuel pressure. Zero in this value means \"unknown\", so if the fuel pressure really is zero kPa use 0.0001 instead."]
11408 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11409 pub fuel_pressure: f32,
11410}
11411impl EFI_STATUS_DATA {
11412 pub const ENCODED_LEN: usize = 73usize;
11413 pub const DEFAULT: Self = Self {
11414 ecu_index: 0.0_f32,
11415 rpm: 0.0_f32,
11416 fuel_consumed: 0.0_f32,
11417 fuel_flow: 0.0_f32,
11418 engine_load: 0.0_f32,
11419 throttle_position: 0.0_f32,
11420 spark_dwell_time: 0.0_f32,
11421 barometric_pressure: 0.0_f32,
11422 intake_manifold_pressure: 0.0_f32,
11423 intake_manifold_temperature: 0.0_f32,
11424 cylinder_head_temperature: 0.0_f32,
11425 ignition_timing: 0.0_f32,
11426 injection_time: 0.0_f32,
11427 exhaust_gas_temperature: 0.0_f32,
11428 throttle_out: 0.0_f32,
11429 pt_compensation: 0.0_f32,
11430 health: 0_u8,
11431 ignition_voltage: 0.0_f32,
11432 fuel_pressure: 0.0_f32,
11433 };
11434 #[cfg(feature = "arbitrary")]
11435 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11436 use arbitrary::{Arbitrary, Unstructured};
11437 let mut buf = [0u8; 1024];
11438 rng.fill_bytes(&mut buf);
11439 let mut unstructured = Unstructured::new(&buf);
11440 Self::arbitrary(&mut unstructured).unwrap_or_default()
11441 }
11442}
11443impl Default for EFI_STATUS_DATA {
11444 fn default() -> Self {
11445 Self::DEFAULT.clone()
11446 }
11447}
11448impl MessageData for EFI_STATUS_DATA {
11449 type Message = MavMessage;
11450 const ID: u32 = 225u32;
11451 const NAME: &'static str = "EFI_STATUS";
11452 const EXTRA_CRC: u8 = 208u8;
11453 const ENCODED_LEN: usize = 73usize;
11454 fn deser(
11455 _version: MavlinkVersion,
11456 __input: &[u8],
11457 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11458 let avail_len = __input.len();
11459 let mut payload_buf = [0; Self::ENCODED_LEN];
11460 let mut buf = if avail_len < Self::ENCODED_LEN {
11461 payload_buf[0..avail_len].copy_from_slice(__input);
11462 Bytes::new(&payload_buf)
11463 } else {
11464 Bytes::new(__input)
11465 };
11466 let mut __struct = Self::default();
11467 __struct.ecu_index = buf.get_f32_le();
11468 __struct.rpm = buf.get_f32_le();
11469 __struct.fuel_consumed = buf.get_f32_le();
11470 __struct.fuel_flow = buf.get_f32_le();
11471 __struct.engine_load = buf.get_f32_le();
11472 __struct.throttle_position = buf.get_f32_le();
11473 __struct.spark_dwell_time = buf.get_f32_le();
11474 __struct.barometric_pressure = buf.get_f32_le();
11475 __struct.intake_manifold_pressure = buf.get_f32_le();
11476 __struct.intake_manifold_temperature = buf.get_f32_le();
11477 __struct.cylinder_head_temperature = buf.get_f32_le();
11478 __struct.ignition_timing = buf.get_f32_le();
11479 __struct.injection_time = buf.get_f32_le();
11480 __struct.exhaust_gas_temperature = buf.get_f32_le();
11481 __struct.throttle_out = buf.get_f32_le();
11482 __struct.pt_compensation = buf.get_f32_le();
11483 __struct.health = buf.get_u8();
11484 __struct.ignition_voltage = buf.get_f32_le();
11485 __struct.fuel_pressure = buf.get_f32_le();
11486 Ok(__struct)
11487 }
11488 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11489 let mut __tmp = BytesMut::new(bytes);
11490 #[allow(clippy::absurd_extreme_comparisons)]
11491 #[allow(unused_comparisons)]
11492 if __tmp.remaining() < Self::ENCODED_LEN {
11493 panic!(
11494 "buffer is too small (need {} bytes, but got {})",
11495 Self::ENCODED_LEN,
11496 __tmp.remaining(),
11497 )
11498 }
11499 __tmp.put_f32_le(self.ecu_index);
11500 __tmp.put_f32_le(self.rpm);
11501 __tmp.put_f32_le(self.fuel_consumed);
11502 __tmp.put_f32_le(self.fuel_flow);
11503 __tmp.put_f32_le(self.engine_load);
11504 __tmp.put_f32_le(self.throttle_position);
11505 __tmp.put_f32_le(self.spark_dwell_time);
11506 __tmp.put_f32_le(self.barometric_pressure);
11507 __tmp.put_f32_le(self.intake_manifold_pressure);
11508 __tmp.put_f32_le(self.intake_manifold_temperature);
11509 __tmp.put_f32_le(self.cylinder_head_temperature);
11510 __tmp.put_f32_le(self.ignition_timing);
11511 __tmp.put_f32_le(self.injection_time);
11512 __tmp.put_f32_le(self.exhaust_gas_temperature);
11513 __tmp.put_f32_le(self.throttle_out);
11514 __tmp.put_f32_le(self.pt_compensation);
11515 __tmp.put_u8(self.health);
11516 if matches!(version, MavlinkVersion::V2) {
11517 __tmp.put_f32_le(self.ignition_voltage);
11518 __tmp.put_f32_le(self.fuel_pressure);
11519 let len = __tmp.len();
11520 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11521 } else {
11522 __tmp.len()
11523 }
11524 }
11525}
11526#[doc = "Data packet for images sent using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
11527#[doc = ""]
11528#[doc = "ID: 131"]
11529#[derive(Debug, Clone, PartialEq)]
11530#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11531#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11532#[cfg_attr(feature = "ts", derive(TS))]
11533#[cfg_attr(feature = "ts", ts(export))]
11534pub struct ENCAPSULATED_DATA_DATA {
11535 #[doc = "sequence number (starting with 0 on every transmission)"]
11536 pub seqnr: u16,
11537 #[doc = "image data bytes"]
11538 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11539 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11540 pub data: [u8; 253],
11541}
11542impl ENCAPSULATED_DATA_DATA {
11543 pub const ENCODED_LEN: usize = 255usize;
11544 pub const DEFAULT: Self = Self {
11545 seqnr: 0_u16,
11546 data: [0_u8; 253usize],
11547 };
11548 #[cfg(feature = "arbitrary")]
11549 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11550 use arbitrary::{Arbitrary, Unstructured};
11551 let mut buf = [0u8; 1024];
11552 rng.fill_bytes(&mut buf);
11553 let mut unstructured = Unstructured::new(&buf);
11554 Self::arbitrary(&mut unstructured).unwrap_or_default()
11555 }
11556}
11557impl Default for ENCAPSULATED_DATA_DATA {
11558 fn default() -> Self {
11559 Self::DEFAULT.clone()
11560 }
11561}
11562impl MessageData for ENCAPSULATED_DATA_DATA {
11563 type Message = MavMessage;
11564 const ID: u32 = 131u32;
11565 const NAME: &'static str = "ENCAPSULATED_DATA";
11566 const EXTRA_CRC: u8 = 223u8;
11567 const ENCODED_LEN: usize = 255usize;
11568 fn deser(
11569 _version: MavlinkVersion,
11570 __input: &[u8],
11571 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11572 let avail_len = __input.len();
11573 let mut payload_buf = [0; Self::ENCODED_LEN];
11574 let mut buf = if avail_len < Self::ENCODED_LEN {
11575 payload_buf[0..avail_len].copy_from_slice(__input);
11576 Bytes::new(&payload_buf)
11577 } else {
11578 Bytes::new(__input)
11579 };
11580 let mut __struct = Self::default();
11581 __struct.seqnr = buf.get_u16_le();
11582 for v in &mut __struct.data {
11583 let val = buf.get_u8();
11584 *v = val;
11585 }
11586 Ok(__struct)
11587 }
11588 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11589 let mut __tmp = BytesMut::new(bytes);
11590 #[allow(clippy::absurd_extreme_comparisons)]
11591 #[allow(unused_comparisons)]
11592 if __tmp.remaining() < Self::ENCODED_LEN {
11593 panic!(
11594 "buffer is too small (need {} bytes, but got {})",
11595 Self::ENCODED_LEN,
11596 __tmp.remaining(),
11597 )
11598 }
11599 __tmp.put_u16_le(self.seqnr);
11600 for val in &self.data {
11601 __tmp.put_u8(*val);
11602 }
11603 if matches!(version, MavlinkVersion::V2) {
11604 let len = __tmp.len();
11605 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11606 } else {
11607 __tmp.len()
11608 }
11609 }
11610}
11611#[doc = "ESC information for lower rate streaming. Recommended streaming rate 1Hz. See ESC_STATUS for higher-rate ESC data."]
11612#[doc = ""]
11613#[doc = "ID: 290"]
11614#[derive(Debug, Clone, PartialEq)]
11615#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11616#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11617#[cfg_attr(feature = "ts", derive(TS))]
11618#[cfg_attr(feature = "ts", ts(export))]
11619pub struct ESC_INFO_DATA {
11620 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number."]
11621 pub time_usec: u64,
11622 #[doc = "Number of reported errors by each ESC since boot."]
11623 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11624 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11625 pub error_count: [u32; 4],
11626 #[doc = "Counter of data packets received."]
11627 pub counter: u16,
11628 #[doc = "Bitmap of ESC failure flags."]
11629 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11630 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11631 pub failure_flags: [u16; 4],
11632 #[doc = "Temperature of each ESC. INT16_MAX: if data not supplied by ESC."]
11633 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11634 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11635 pub temperature: [i16; 4],
11636 #[doc = "Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4."]
11637 pub index: u8,
11638 #[doc = "Total number of ESCs in all messages of this type. Message fields with an index higher than this should be ignored because they contain invalid data."]
11639 pub count: u8,
11640 #[doc = "Connection type protocol for all ESC."]
11641 pub connection_type: EscConnectionType,
11642 #[doc = "Information regarding online/offline status of each ESC."]
11643 pub info: u8,
11644}
11645impl ESC_INFO_DATA {
11646 pub const ENCODED_LEN: usize = 46usize;
11647 pub const DEFAULT: Self = Self {
11648 time_usec: 0_u64,
11649 error_count: [0_u32; 4usize],
11650 counter: 0_u16,
11651 failure_flags: [0_u16; 4usize],
11652 temperature: [0_i16; 4usize],
11653 index: 0_u8,
11654 count: 0_u8,
11655 connection_type: EscConnectionType::DEFAULT,
11656 info: 0_u8,
11657 };
11658 #[cfg(feature = "arbitrary")]
11659 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11660 use arbitrary::{Arbitrary, Unstructured};
11661 let mut buf = [0u8; 1024];
11662 rng.fill_bytes(&mut buf);
11663 let mut unstructured = Unstructured::new(&buf);
11664 Self::arbitrary(&mut unstructured).unwrap_or_default()
11665 }
11666}
11667impl Default for ESC_INFO_DATA {
11668 fn default() -> Self {
11669 Self::DEFAULT.clone()
11670 }
11671}
11672impl MessageData for ESC_INFO_DATA {
11673 type Message = MavMessage;
11674 const ID: u32 = 290u32;
11675 const NAME: &'static str = "ESC_INFO";
11676 const EXTRA_CRC: u8 = 251u8;
11677 const ENCODED_LEN: usize = 46usize;
11678 fn deser(
11679 _version: MavlinkVersion,
11680 __input: &[u8],
11681 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11682 let avail_len = __input.len();
11683 let mut payload_buf = [0; Self::ENCODED_LEN];
11684 let mut buf = if avail_len < Self::ENCODED_LEN {
11685 payload_buf[0..avail_len].copy_from_slice(__input);
11686 Bytes::new(&payload_buf)
11687 } else {
11688 Bytes::new(__input)
11689 };
11690 let mut __struct = Self::default();
11691 __struct.time_usec = buf.get_u64_le();
11692 for v in &mut __struct.error_count {
11693 let val = buf.get_u32_le();
11694 *v = val;
11695 }
11696 __struct.counter = buf.get_u16_le();
11697 for v in &mut __struct.failure_flags {
11698 let val = buf.get_u16_le();
11699 *v = val;
11700 }
11701 for v in &mut __struct.temperature {
11702 let val = buf.get_i16_le();
11703 *v = val;
11704 }
11705 __struct.index = buf.get_u8();
11706 __struct.count = buf.get_u8();
11707 let tmp = buf.get_u8();
11708 __struct.connection_type =
11709 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11710 enum_type: "EscConnectionType",
11711 value: tmp as u32,
11712 })?;
11713 __struct.info = buf.get_u8();
11714 Ok(__struct)
11715 }
11716 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11717 let mut __tmp = BytesMut::new(bytes);
11718 #[allow(clippy::absurd_extreme_comparisons)]
11719 #[allow(unused_comparisons)]
11720 if __tmp.remaining() < Self::ENCODED_LEN {
11721 panic!(
11722 "buffer is too small (need {} bytes, but got {})",
11723 Self::ENCODED_LEN,
11724 __tmp.remaining(),
11725 )
11726 }
11727 __tmp.put_u64_le(self.time_usec);
11728 for val in &self.error_count {
11729 __tmp.put_u32_le(*val);
11730 }
11731 __tmp.put_u16_le(self.counter);
11732 for val in &self.failure_flags {
11733 __tmp.put_u16_le(*val);
11734 }
11735 for val in &self.temperature {
11736 __tmp.put_i16_le(*val);
11737 }
11738 __tmp.put_u8(self.index);
11739 __tmp.put_u8(self.count);
11740 __tmp.put_u8(self.connection_type as u8);
11741 __tmp.put_u8(self.info);
11742 if matches!(version, MavlinkVersion::V2) {
11743 let len = __tmp.len();
11744 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11745 } else {
11746 __tmp.len()
11747 }
11748 }
11749}
11750#[doc = "ESC information for higher rate streaming. Recommended streaming rate is ~10 Hz. Information that changes more slowly is sent in ESC_INFO. It should typically only be streamed on high-bandwidth links (i.e. to a companion computer)."]
11751#[doc = ""]
11752#[doc = "ID: 291"]
11753#[derive(Debug, Clone, PartialEq)]
11754#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11755#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11756#[cfg_attr(feature = "ts", derive(TS))]
11757#[cfg_attr(feature = "ts", ts(export))]
11758pub struct ESC_STATUS_DATA {
11759 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number."]
11760 pub time_usec: u64,
11761 #[doc = "Reported motor RPM from each ESC (negative for reverse rotation)."]
11762 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11763 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11764 pub rpm: [i32; 4],
11765 #[doc = "Voltage measured from each ESC."]
11766 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11767 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11768 pub voltage: [f32; 4],
11769 #[doc = "Current measured from each ESC."]
11770 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11771 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11772 pub current: [f32; 4],
11773 #[doc = "Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4."]
11774 pub index: u8,
11775}
11776impl ESC_STATUS_DATA {
11777 pub const ENCODED_LEN: usize = 57usize;
11778 pub const DEFAULT: Self = Self {
11779 time_usec: 0_u64,
11780 rpm: [0_i32; 4usize],
11781 voltage: [0.0_f32; 4usize],
11782 current: [0.0_f32; 4usize],
11783 index: 0_u8,
11784 };
11785 #[cfg(feature = "arbitrary")]
11786 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11787 use arbitrary::{Arbitrary, Unstructured};
11788 let mut buf = [0u8; 1024];
11789 rng.fill_bytes(&mut buf);
11790 let mut unstructured = Unstructured::new(&buf);
11791 Self::arbitrary(&mut unstructured).unwrap_or_default()
11792 }
11793}
11794impl Default for ESC_STATUS_DATA {
11795 fn default() -> Self {
11796 Self::DEFAULT.clone()
11797 }
11798}
11799impl MessageData for ESC_STATUS_DATA {
11800 type Message = MavMessage;
11801 const ID: u32 = 291u32;
11802 const NAME: &'static str = "ESC_STATUS";
11803 const EXTRA_CRC: u8 = 10u8;
11804 const ENCODED_LEN: usize = 57usize;
11805 fn deser(
11806 _version: MavlinkVersion,
11807 __input: &[u8],
11808 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11809 let avail_len = __input.len();
11810 let mut payload_buf = [0; Self::ENCODED_LEN];
11811 let mut buf = if avail_len < Self::ENCODED_LEN {
11812 payload_buf[0..avail_len].copy_from_slice(__input);
11813 Bytes::new(&payload_buf)
11814 } else {
11815 Bytes::new(__input)
11816 };
11817 let mut __struct = Self::default();
11818 __struct.time_usec = buf.get_u64_le();
11819 for v in &mut __struct.rpm {
11820 let val = buf.get_i32_le();
11821 *v = val;
11822 }
11823 for v in &mut __struct.voltage {
11824 let val = buf.get_f32_le();
11825 *v = val;
11826 }
11827 for v in &mut __struct.current {
11828 let val = buf.get_f32_le();
11829 *v = val;
11830 }
11831 __struct.index = buf.get_u8();
11832 Ok(__struct)
11833 }
11834 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11835 let mut __tmp = BytesMut::new(bytes);
11836 #[allow(clippy::absurd_extreme_comparisons)]
11837 #[allow(unused_comparisons)]
11838 if __tmp.remaining() < Self::ENCODED_LEN {
11839 panic!(
11840 "buffer is too small (need {} bytes, but got {})",
11841 Self::ENCODED_LEN,
11842 __tmp.remaining(),
11843 )
11844 }
11845 __tmp.put_u64_le(self.time_usec);
11846 for val in &self.rpm {
11847 __tmp.put_i32_le(*val);
11848 }
11849 for val in &self.voltage {
11850 __tmp.put_f32_le(*val);
11851 }
11852 for val in &self.current {
11853 __tmp.put_f32_le(*val);
11854 }
11855 __tmp.put_u8(self.index);
11856 if matches!(version, MavlinkVersion::V2) {
11857 let len = __tmp.len();
11858 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11859 } else {
11860 __tmp.len()
11861 }
11862 }
11863}
11864#[doc = "Estimator status message including flags, innovation test ratios and estimated accuracies. The flags message is an integer bitmask containing information on which EKF outputs are valid. See the ESTIMATOR_STATUS_FLAGS enum definition for further information. The innovation test ratios show the magnitude of the sensor innovation divided by the innovation check threshold. Under normal operation the innovation test ratios should be below 0.5 with occasional values up to 1.0. Values greater than 1.0 should be rare under normal operation and indicate that a measurement has been rejected by the filter. The user should be notified if an innovation test ratio greater than 1.0 is recorded. Notifications for values in the range between 0.5 and 1.0 should be optional and controllable by the user."]
11865#[doc = ""]
11866#[doc = "ID: 230"]
11867#[derive(Debug, Clone, PartialEq)]
11868#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11869#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11870#[cfg_attr(feature = "ts", derive(TS))]
11871#[cfg_attr(feature = "ts", ts(export))]
11872pub struct ESTIMATOR_STATUS_DATA {
11873 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
11874 pub time_usec: u64,
11875 #[doc = "Velocity innovation test ratio"]
11876 pub vel_ratio: f32,
11877 #[doc = "Horizontal position innovation test ratio"]
11878 pub pos_horiz_ratio: f32,
11879 #[doc = "Vertical position innovation test ratio"]
11880 pub pos_vert_ratio: f32,
11881 #[doc = "Magnetometer innovation test ratio"]
11882 pub mag_ratio: f32,
11883 #[doc = "Height above terrain innovation test ratio"]
11884 pub hagl_ratio: f32,
11885 #[doc = "True airspeed innovation test ratio"]
11886 pub tas_ratio: f32,
11887 #[doc = "Horizontal position 1-STD accuracy relative to the EKF local origin"]
11888 pub pos_horiz_accuracy: f32,
11889 #[doc = "Vertical position 1-STD accuracy relative to the EKF local origin"]
11890 pub pos_vert_accuracy: f32,
11891 #[doc = "Bitmap indicating which EKF outputs are valid."]
11892 pub flags: EstimatorStatusFlags,
11893}
11894impl ESTIMATOR_STATUS_DATA {
11895 pub const ENCODED_LEN: usize = 42usize;
11896 pub const DEFAULT: Self = Self {
11897 time_usec: 0_u64,
11898 vel_ratio: 0.0_f32,
11899 pos_horiz_ratio: 0.0_f32,
11900 pos_vert_ratio: 0.0_f32,
11901 mag_ratio: 0.0_f32,
11902 hagl_ratio: 0.0_f32,
11903 tas_ratio: 0.0_f32,
11904 pos_horiz_accuracy: 0.0_f32,
11905 pos_vert_accuracy: 0.0_f32,
11906 flags: EstimatorStatusFlags::DEFAULT,
11907 };
11908 #[cfg(feature = "arbitrary")]
11909 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11910 use arbitrary::{Arbitrary, Unstructured};
11911 let mut buf = [0u8; 1024];
11912 rng.fill_bytes(&mut buf);
11913 let mut unstructured = Unstructured::new(&buf);
11914 Self::arbitrary(&mut unstructured).unwrap_or_default()
11915 }
11916}
11917impl Default for ESTIMATOR_STATUS_DATA {
11918 fn default() -> Self {
11919 Self::DEFAULT.clone()
11920 }
11921}
11922impl MessageData for ESTIMATOR_STATUS_DATA {
11923 type Message = MavMessage;
11924 const ID: u32 = 230u32;
11925 const NAME: &'static str = "ESTIMATOR_STATUS";
11926 const EXTRA_CRC: u8 = 163u8;
11927 const ENCODED_LEN: usize = 42usize;
11928 fn deser(
11929 _version: MavlinkVersion,
11930 __input: &[u8],
11931 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11932 let avail_len = __input.len();
11933 let mut payload_buf = [0; Self::ENCODED_LEN];
11934 let mut buf = if avail_len < Self::ENCODED_LEN {
11935 payload_buf[0..avail_len].copy_from_slice(__input);
11936 Bytes::new(&payload_buf)
11937 } else {
11938 Bytes::new(__input)
11939 };
11940 let mut __struct = Self::default();
11941 __struct.time_usec = buf.get_u64_le();
11942 __struct.vel_ratio = buf.get_f32_le();
11943 __struct.pos_horiz_ratio = buf.get_f32_le();
11944 __struct.pos_vert_ratio = buf.get_f32_le();
11945 __struct.mag_ratio = buf.get_f32_le();
11946 __struct.hagl_ratio = buf.get_f32_le();
11947 __struct.tas_ratio = buf.get_f32_le();
11948 __struct.pos_horiz_accuracy = buf.get_f32_le();
11949 __struct.pos_vert_accuracy = buf.get_f32_le();
11950 let tmp = buf.get_u16_le();
11951 __struct.flags = EstimatorStatusFlags::from_bits(tmp & EstimatorStatusFlags::all().bits())
11952 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
11953 flag_type: "EstimatorStatusFlags",
11954 value: tmp as u32,
11955 })?;
11956 Ok(__struct)
11957 }
11958 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11959 let mut __tmp = BytesMut::new(bytes);
11960 #[allow(clippy::absurd_extreme_comparisons)]
11961 #[allow(unused_comparisons)]
11962 if __tmp.remaining() < Self::ENCODED_LEN {
11963 panic!(
11964 "buffer is too small (need {} bytes, but got {})",
11965 Self::ENCODED_LEN,
11966 __tmp.remaining(),
11967 )
11968 }
11969 __tmp.put_u64_le(self.time_usec);
11970 __tmp.put_f32_le(self.vel_ratio);
11971 __tmp.put_f32_le(self.pos_horiz_ratio);
11972 __tmp.put_f32_le(self.pos_vert_ratio);
11973 __tmp.put_f32_le(self.mag_ratio);
11974 __tmp.put_f32_le(self.hagl_ratio);
11975 __tmp.put_f32_le(self.tas_ratio);
11976 __tmp.put_f32_le(self.pos_horiz_accuracy);
11977 __tmp.put_f32_le(self.pos_vert_accuracy);
11978 __tmp.put_u16_le(self.flags.bits());
11979 if matches!(version, MavlinkVersion::V2) {
11980 let len = __tmp.len();
11981 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11982 } else {
11983 __tmp.len()
11984 }
11985 }
11986}
11987#[doc = "Event message. Each new event from a particular component gets a new sequence number. The same message might be sent multiple times if (re-)requested. Most events are broadcast, some can be specific to a target component (as receivers keep track of the sequence for missed events, all events need to be broadcast. Thus we use destination_component instead of target_component)."]
11988#[doc = ""]
11989#[doc = "ID: 410"]
11990#[derive(Debug, Clone, PartialEq)]
11991#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11992#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11993#[cfg_attr(feature = "ts", derive(TS))]
11994#[cfg_attr(feature = "ts", ts(export))]
11995pub struct EVENT_DATA {
11996 #[doc = "Event ID (as defined in the component metadata)"]
11997 pub id: u32,
11998 #[doc = "Timestamp (time since system boot when the event happened)."]
11999 pub event_time_boot_ms: u32,
12000 #[doc = "Sequence number."]
12001 pub sequence: u16,
12002 #[doc = "Component ID"]
12003 pub destination_component: u8,
12004 #[doc = "System ID"]
12005 pub destination_system: u8,
12006 #[doc = "Log levels: 4 bits MSB: internal (for logging purposes), 4 bits LSB: external. Levels: Emergency = 0, Alert = 1, Critical = 2, Error = 3, Warning = 4, Notice = 5, Info = 6, Debug = 7, Protocol = 8, Disabled = 9"]
12007 pub log_levels: u8,
12008 #[doc = "Arguments (depend on event ID)."]
12009 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12010 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12011 pub arguments: [u8; 40],
12012}
12013impl EVENT_DATA {
12014 pub const ENCODED_LEN: usize = 53usize;
12015 pub const DEFAULT: Self = Self {
12016 id: 0_u32,
12017 event_time_boot_ms: 0_u32,
12018 sequence: 0_u16,
12019 destination_component: 0_u8,
12020 destination_system: 0_u8,
12021 log_levels: 0_u8,
12022 arguments: [0_u8; 40usize],
12023 };
12024 #[cfg(feature = "arbitrary")]
12025 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12026 use arbitrary::{Arbitrary, Unstructured};
12027 let mut buf = [0u8; 1024];
12028 rng.fill_bytes(&mut buf);
12029 let mut unstructured = Unstructured::new(&buf);
12030 Self::arbitrary(&mut unstructured).unwrap_or_default()
12031 }
12032}
12033impl Default for EVENT_DATA {
12034 fn default() -> Self {
12035 Self::DEFAULT.clone()
12036 }
12037}
12038impl MessageData for EVENT_DATA {
12039 type Message = MavMessage;
12040 const ID: u32 = 410u32;
12041 const NAME: &'static str = "EVENT";
12042 const EXTRA_CRC: u8 = 160u8;
12043 const ENCODED_LEN: usize = 53usize;
12044 fn deser(
12045 _version: MavlinkVersion,
12046 __input: &[u8],
12047 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12048 let avail_len = __input.len();
12049 let mut payload_buf = [0; Self::ENCODED_LEN];
12050 let mut buf = if avail_len < Self::ENCODED_LEN {
12051 payload_buf[0..avail_len].copy_from_slice(__input);
12052 Bytes::new(&payload_buf)
12053 } else {
12054 Bytes::new(__input)
12055 };
12056 let mut __struct = Self::default();
12057 __struct.id = buf.get_u32_le();
12058 __struct.event_time_boot_ms = buf.get_u32_le();
12059 __struct.sequence = buf.get_u16_le();
12060 __struct.destination_component = buf.get_u8();
12061 __struct.destination_system = buf.get_u8();
12062 __struct.log_levels = buf.get_u8();
12063 for v in &mut __struct.arguments {
12064 let val = buf.get_u8();
12065 *v = val;
12066 }
12067 Ok(__struct)
12068 }
12069 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12070 let mut __tmp = BytesMut::new(bytes);
12071 #[allow(clippy::absurd_extreme_comparisons)]
12072 #[allow(unused_comparisons)]
12073 if __tmp.remaining() < Self::ENCODED_LEN {
12074 panic!(
12075 "buffer is too small (need {} bytes, but got {})",
12076 Self::ENCODED_LEN,
12077 __tmp.remaining(),
12078 )
12079 }
12080 __tmp.put_u32_le(self.id);
12081 __tmp.put_u32_le(self.event_time_boot_ms);
12082 __tmp.put_u16_le(self.sequence);
12083 __tmp.put_u8(self.destination_component);
12084 __tmp.put_u8(self.destination_system);
12085 __tmp.put_u8(self.log_levels);
12086 for val in &self.arguments {
12087 __tmp.put_u8(*val);
12088 }
12089 if matches!(version, MavlinkVersion::V2) {
12090 let len = __tmp.len();
12091 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12092 } else {
12093 __tmp.len()
12094 }
12095 }
12096}
12097#[doc = "Provides state for additional features."]
12098#[doc = ""]
12099#[doc = "ID: 245"]
12100#[derive(Debug, Clone, PartialEq)]
12101#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12102#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12103#[cfg_attr(feature = "ts", derive(TS))]
12104#[cfg_attr(feature = "ts", ts(export))]
12105pub struct EXTENDED_SYS_STATE_DATA {
12106 #[doc = "The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration."]
12107 pub vtol_state: MavVtolState,
12108 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
12109 pub landed_state: MavLandedState,
12110}
12111impl EXTENDED_SYS_STATE_DATA {
12112 pub const ENCODED_LEN: usize = 2usize;
12113 pub const DEFAULT: Self = Self {
12114 vtol_state: MavVtolState::DEFAULT,
12115 landed_state: MavLandedState::DEFAULT,
12116 };
12117 #[cfg(feature = "arbitrary")]
12118 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12119 use arbitrary::{Arbitrary, Unstructured};
12120 let mut buf = [0u8; 1024];
12121 rng.fill_bytes(&mut buf);
12122 let mut unstructured = Unstructured::new(&buf);
12123 Self::arbitrary(&mut unstructured).unwrap_or_default()
12124 }
12125}
12126impl Default for EXTENDED_SYS_STATE_DATA {
12127 fn default() -> Self {
12128 Self::DEFAULT.clone()
12129 }
12130}
12131impl MessageData for EXTENDED_SYS_STATE_DATA {
12132 type Message = MavMessage;
12133 const ID: u32 = 245u32;
12134 const NAME: &'static str = "EXTENDED_SYS_STATE";
12135 const EXTRA_CRC: u8 = 130u8;
12136 const ENCODED_LEN: usize = 2usize;
12137 fn deser(
12138 _version: MavlinkVersion,
12139 __input: &[u8],
12140 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12141 let avail_len = __input.len();
12142 let mut payload_buf = [0; Self::ENCODED_LEN];
12143 let mut buf = if avail_len < Self::ENCODED_LEN {
12144 payload_buf[0..avail_len].copy_from_slice(__input);
12145 Bytes::new(&payload_buf)
12146 } else {
12147 Bytes::new(__input)
12148 };
12149 let mut __struct = Self::default();
12150 let tmp = buf.get_u8();
12151 __struct.vtol_state =
12152 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
12153 enum_type: "MavVtolState",
12154 value: tmp as u32,
12155 })?;
12156 let tmp = buf.get_u8();
12157 __struct.landed_state =
12158 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
12159 enum_type: "MavLandedState",
12160 value: tmp as u32,
12161 })?;
12162 Ok(__struct)
12163 }
12164 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12165 let mut __tmp = BytesMut::new(bytes);
12166 #[allow(clippy::absurd_extreme_comparisons)]
12167 #[allow(unused_comparisons)]
12168 if __tmp.remaining() < Self::ENCODED_LEN {
12169 panic!(
12170 "buffer is too small (need {} bytes, but got {})",
12171 Self::ENCODED_LEN,
12172 __tmp.remaining(),
12173 )
12174 }
12175 __tmp.put_u8(self.vtol_state as u8);
12176 __tmp.put_u8(self.landed_state as u8);
12177 if matches!(version, MavlinkVersion::V2) {
12178 let len = __tmp.len();
12179 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12180 } else {
12181 __tmp.len()
12182 }
12183 }
12184}
12185#[doc = "Status of geo-fencing. Sent in extended status stream when fencing enabled."]
12186#[doc = ""]
12187#[doc = "ID: 162"]
12188#[derive(Debug, Clone, PartialEq)]
12189#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12190#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12191#[cfg_attr(feature = "ts", derive(TS))]
12192#[cfg_attr(feature = "ts", ts(export))]
12193pub struct FENCE_STATUS_DATA {
12194 #[doc = "Time (since boot) of last breach."]
12195 pub breach_time: u32,
12196 #[doc = "Number of fence breaches."]
12197 pub breach_count: u16,
12198 #[doc = "Breach status (0 if currently inside fence, 1 if outside)."]
12199 pub breach_status: u8,
12200 #[doc = "Last breach type."]
12201 pub breach_type: FenceBreach,
12202 #[doc = "Active action to prevent fence breach"]
12203 #[cfg_attr(feature = "serde", serde(default))]
12204 pub breach_mitigation: FenceMitigate,
12205}
12206impl FENCE_STATUS_DATA {
12207 pub const ENCODED_LEN: usize = 9usize;
12208 pub const DEFAULT: Self = Self {
12209 breach_time: 0_u32,
12210 breach_count: 0_u16,
12211 breach_status: 0_u8,
12212 breach_type: FenceBreach::DEFAULT,
12213 breach_mitigation: FenceMitigate::DEFAULT,
12214 };
12215 #[cfg(feature = "arbitrary")]
12216 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12217 use arbitrary::{Arbitrary, Unstructured};
12218 let mut buf = [0u8; 1024];
12219 rng.fill_bytes(&mut buf);
12220 let mut unstructured = Unstructured::new(&buf);
12221 Self::arbitrary(&mut unstructured).unwrap_or_default()
12222 }
12223}
12224impl Default for FENCE_STATUS_DATA {
12225 fn default() -> Self {
12226 Self::DEFAULT.clone()
12227 }
12228}
12229impl MessageData for FENCE_STATUS_DATA {
12230 type Message = MavMessage;
12231 const ID: u32 = 162u32;
12232 const NAME: &'static str = "FENCE_STATUS";
12233 const EXTRA_CRC: u8 = 189u8;
12234 const ENCODED_LEN: usize = 9usize;
12235 fn deser(
12236 _version: MavlinkVersion,
12237 __input: &[u8],
12238 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12239 let avail_len = __input.len();
12240 let mut payload_buf = [0; Self::ENCODED_LEN];
12241 let mut buf = if avail_len < Self::ENCODED_LEN {
12242 payload_buf[0..avail_len].copy_from_slice(__input);
12243 Bytes::new(&payload_buf)
12244 } else {
12245 Bytes::new(__input)
12246 };
12247 let mut __struct = Self::default();
12248 __struct.breach_time = buf.get_u32_le();
12249 __struct.breach_count = buf.get_u16_le();
12250 __struct.breach_status = buf.get_u8();
12251 let tmp = buf.get_u8();
12252 __struct.breach_type =
12253 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
12254 enum_type: "FenceBreach",
12255 value: tmp as u32,
12256 })?;
12257 let tmp = buf.get_u8();
12258 __struct.breach_mitigation =
12259 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
12260 enum_type: "FenceMitigate",
12261 value: tmp as u32,
12262 })?;
12263 Ok(__struct)
12264 }
12265 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12266 let mut __tmp = BytesMut::new(bytes);
12267 #[allow(clippy::absurd_extreme_comparisons)]
12268 #[allow(unused_comparisons)]
12269 if __tmp.remaining() < Self::ENCODED_LEN {
12270 panic!(
12271 "buffer is too small (need {} bytes, but got {})",
12272 Self::ENCODED_LEN,
12273 __tmp.remaining(),
12274 )
12275 }
12276 __tmp.put_u32_le(self.breach_time);
12277 __tmp.put_u16_le(self.breach_count);
12278 __tmp.put_u8(self.breach_status);
12279 __tmp.put_u8(self.breach_type as u8);
12280 if matches!(version, MavlinkVersion::V2) {
12281 __tmp.put_u8(self.breach_mitigation as u8);
12282 let len = __tmp.len();
12283 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12284 } else {
12285 __tmp.len()
12286 }
12287 }
12288}
12289#[doc = "File transfer protocol message: <https://mavlink.io/en/services/ftp.html>."]
12290#[doc = ""]
12291#[doc = "ID: 110"]
12292#[derive(Debug, Clone, PartialEq)]
12293#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12294#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12295#[cfg_attr(feature = "ts", derive(TS))]
12296#[cfg_attr(feature = "ts", ts(export))]
12297pub struct FILE_TRANSFER_PROTOCOL_DATA {
12298 #[doc = "Network ID (0 for broadcast)"]
12299 pub target_network: u8,
12300 #[doc = "System ID (0 for broadcast)"]
12301 pub target_system: u8,
12302 #[doc = "Component ID (0 for broadcast)"]
12303 pub target_component: u8,
12304 #[doc = "Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The content/format of this block is defined in <https://mavlink.io/en/services/ftp.html>."]
12305 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12306 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12307 pub payload: [u8; 251],
12308}
12309impl FILE_TRANSFER_PROTOCOL_DATA {
12310 pub const ENCODED_LEN: usize = 254usize;
12311 pub const DEFAULT: Self = Self {
12312 target_network: 0_u8,
12313 target_system: 0_u8,
12314 target_component: 0_u8,
12315 payload: [0_u8; 251usize],
12316 };
12317 #[cfg(feature = "arbitrary")]
12318 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12319 use arbitrary::{Arbitrary, Unstructured};
12320 let mut buf = [0u8; 1024];
12321 rng.fill_bytes(&mut buf);
12322 let mut unstructured = Unstructured::new(&buf);
12323 Self::arbitrary(&mut unstructured).unwrap_or_default()
12324 }
12325}
12326impl Default for FILE_TRANSFER_PROTOCOL_DATA {
12327 fn default() -> Self {
12328 Self::DEFAULT.clone()
12329 }
12330}
12331impl MessageData for FILE_TRANSFER_PROTOCOL_DATA {
12332 type Message = MavMessage;
12333 const ID: u32 = 110u32;
12334 const NAME: &'static str = "FILE_TRANSFER_PROTOCOL";
12335 const EXTRA_CRC: u8 = 84u8;
12336 const ENCODED_LEN: usize = 254usize;
12337 fn deser(
12338 _version: MavlinkVersion,
12339 __input: &[u8],
12340 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12341 let avail_len = __input.len();
12342 let mut payload_buf = [0; Self::ENCODED_LEN];
12343 let mut buf = if avail_len < Self::ENCODED_LEN {
12344 payload_buf[0..avail_len].copy_from_slice(__input);
12345 Bytes::new(&payload_buf)
12346 } else {
12347 Bytes::new(__input)
12348 };
12349 let mut __struct = Self::default();
12350 __struct.target_network = buf.get_u8();
12351 __struct.target_system = buf.get_u8();
12352 __struct.target_component = buf.get_u8();
12353 for v in &mut __struct.payload {
12354 let val = buf.get_u8();
12355 *v = val;
12356 }
12357 Ok(__struct)
12358 }
12359 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12360 let mut __tmp = BytesMut::new(bytes);
12361 #[allow(clippy::absurd_extreme_comparisons)]
12362 #[allow(unused_comparisons)]
12363 if __tmp.remaining() < Self::ENCODED_LEN {
12364 panic!(
12365 "buffer is too small (need {} bytes, but got {})",
12366 Self::ENCODED_LEN,
12367 __tmp.remaining(),
12368 )
12369 }
12370 __tmp.put_u8(self.target_network);
12371 __tmp.put_u8(self.target_system);
12372 __tmp.put_u8(self.target_component);
12373 for val in &self.payload {
12374 __tmp.put_u8(*val);
12375 }
12376 if matches!(version, MavlinkVersion::V2) {
12377 let len = __tmp.len();
12378 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12379 } else {
12380 __tmp.len()
12381 }
12382 }
12383}
12384#[doc = "Flight information. This includes time since boot for arm, takeoff, and land, and a flight number. Takeoff and landing values reset to zero on arm. This can be requested using MAV_CMD_REQUEST_MESSAGE. Note, some fields are misnamed - timestamps are from boot (not UTC) and the flight_uuid is a sequence number."]
12385#[doc = ""]
12386#[doc = "ID: 264"]
12387#[derive(Debug, Clone, PartialEq)]
12388#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12389#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12390#[cfg_attr(feature = "ts", derive(TS))]
12391#[cfg_attr(feature = "ts", ts(export))]
12392pub struct FLIGHT_INFORMATION_DATA {
12393 #[doc = "Timestamp at arming (since system boot). Set to 0 on boot. Set value on arming. Note, field is misnamed UTC."]
12394 pub arming_time_utc: u64,
12395 #[doc = "Timestamp at takeoff (since system boot). Set to 0 at boot and on arming. Note, field is misnamed UTC."]
12396 pub takeoff_time_utc: u64,
12397 #[doc = "Flight number. Note, field is misnamed UUID."]
12398 pub flight_uuid: u64,
12399 #[doc = "Timestamp (time since system boot)."]
12400 pub time_boot_ms: u32,
12401 #[doc = "Timestamp at landing (in ms since system boot). Set to 0 at boot and on arming."]
12402 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12403 pub landing_time: u32,
12404}
12405impl FLIGHT_INFORMATION_DATA {
12406 pub const ENCODED_LEN: usize = 32usize;
12407 pub const DEFAULT: Self = Self {
12408 arming_time_utc: 0_u64,
12409 takeoff_time_utc: 0_u64,
12410 flight_uuid: 0_u64,
12411 time_boot_ms: 0_u32,
12412 landing_time: 0_u32,
12413 };
12414 #[cfg(feature = "arbitrary")]
12415 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12416 use arbitrary::{Arbitrary, Unstructured};
12417 let mut buf = [0u8; 1024];
12418 rng.fill_bytes(&mut buf);
12419 let mut unstructured = Unstructured::new(&buf);
12420 Self::arbitrary(&mut unstructured).unwrap_or_default()
12421 }
12422}
12423impl Default for FLIGHT_INFORMATION_DATA {
12424 fn default() -> Self {
12425 Self::DEFAULT.clone()
12426 }
12427}
12428impl MessageData for FLIGHT_INFORMATION_DATA {
12429 type Message = MavMessage;
12430 const ID: u32 = 264u32;
12431 const NAME: &'static str = "FLIGHT_INFORMATION";
12432 const EXTRA_CRC: u8 = 49u8;
12433 const ENCODED_LEN: usize = 32usize;
12434 fn deser(
12435 _version: MavlinkVersion,
12436 __input: &[u8],
12437 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12438 let avail_len = __input.len();
12439 let mut payload_buf = [0; Self::ENCODED_LEN];
12440 let mut buf = if avail_len < Self::ENCODED_LEN {
12441 payload_buf[0..avail_len].copy_from_slice(__input);
12442 Bytes::new(&payload_buf)
12443 } else {
12444 Bytes::new(__input)
12445 };
12446 let mut __struct = Self::default();
12447 __struct.arming_time_utc = buf.get_u64_le();
12448 __struct.takeoff_time_utc = buf.get_u64_le();
12449 __struct.flight_uuid = buf.get_u64_le();
12450 __struct.time_boot_ms = buf.get_u32_le();
12451 __struct.landing_time = buf.get_u32_le();
12452 Ok(__struct)
12453 }
12454 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12455 let mut __tmp = BytesMut::new(bytes);
12456 #[allow(clippy::absurd_extreme_comparisons)]
12457 #[allow(unused_comparisons)]
12458 if __tmp.remaining() < Self::ENCODED_LEN {
12459 panic!(
12460 "buffer is too small (need {} bytes, but got {})",
12461 Self::ENCODED_LEN,
12462 __tmp.remaining(),
12463 )
12464 }
12465 __tmp.put_u64_le(self.arming_time_utc);
12466 __tmp.put_u64_le(self.takeoff_time_utc);
12467 __tmp.put_u64_le(self.flight_uuid);
12468 __tmp.put_u32_le(self.time_boot_ms);
12469 if matches!(version, MavlinkVersion::V2) {
12470 __tmp.put_u32_le(self.landing_time);
12471 let len = __tmp.len();
12472 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12473 } else {
12474 __tmp.len()
12475 }
12476 }
12477}
12478#[doc = "Current motion information from a designated system."]
12479#[doc = ""]
12480#[doc = "ID: 144"]
12481#[derive(Debug, Clone, PartialEq)]
12482#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12483#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12484#[cfg_attr(feature = "ts", derive(TS))]
12485#[cfg_attr(feature = "ts", ts(export))]
12486pub struct FOLLOW_TARGET_DATA {
12487 #[doc = "Timestamp (time since system boot)."]
12488 pub timestamp: u64,
12489 #[doc = "button states or switches of a tracker device"]
12490 pub custom_state: u64,
12491 #[doc = "Latitude (WGS84)"]
12492 pub lat: i32,
12493 #[doc = "Longitude (WGS84)"]
12494 pub lon: i32,
12495 #[doc = "Altitude (MSL)"]
12496 pub alt: f32,
12497 #[doc = "target velocity (0,0,0) for unknown"]
12498 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12499 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12500 pub vel: [f32; 3],
12501 #[doc = "linear target acceleration (0,0,0) for unknown"]
12502 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12503 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12504 pub acc: [f32; 3],
12505 #[doc = "(0 0 0 0 for unknown)"]
12506 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12507 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12508 pub attitude_q: [f32; 4],
12509 #[doc = "(0 0 0 for unknown)"]
12510 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12511 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12512 pub rates: [f32; 3],
12513 #[doc = "eph epv"]
12514 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12515 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12516 pub position_cov: [f32; 3],
12517 #[doc = "bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3)"]
12518 pub est_capabilities: u8,
12519}
12520impl FOLLOW_TARGET_DATA {
12521 pub const ENCODED_LEN: usize = 93usize;
12522 pub const DEFAULT: Self = Self {
12523 timestamp: 0_u64,
12524 custom_state: 0_u64,
12525 lat: 0_i32,
12526 lon: 0_i32,
12527 alt: 0.0_f32,
12528 vel: [0.0_f32; 3usize],
12529 acc: [0.0_f32; 3usize],
12530 attitude_q: [0.0_f32; 4usize],
12531 rates: [0.0_f32; 3usize],
12532 position_cov: [0.0_f32; 3usize],
12533 est_capabilities: 0_u8,
12534 };
12535 #[cfg(feature = "arbitrary")]
12536 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12537 use arbitrary::{Arbitrary, Unstructured};
12538 let mut buf = [0u8; 1024];
12539 rng.fill_bytes(&mut buf);
12540 let mut unstructured = Unstructured::new(&buf);
12541 Self::arbitrary(&mut unstructured).unwrap_or_default()
12542 }
12543}
12544impl Default for FOLLOW_TARGET_DATA {
12545 fn default() -> Self {
12546 Self::DEFAULT.clone()
12547 }
12548}
12549impl MessageData for FOLLOW_TARGET_DATA {
12550 type Message = MavMessage;
12551 const ID: u32 = 144u32;
12552 const NAME: &'static str = "FOLLOW_TARGET";
12553 const EXTRA_CRC: u8 = 127u8;
12554 const ENCODED_LEN: usize = 93usize;
12555 fn deser(
12556 _version: MavlinkVersion,
12557 __input: &[u8],
12558 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12559 let avail_len = __input.len();
12560 let mut payload_buf = [0; Self::ENCODED_LEN];
12561 let mut buf = if avail_len < Self::ENCODED_LEN {
12562 payload_buf[0..avail_len].copy_from_slice(__input);
12563 Bytes::new(&payload_buf)
12564 } else {
12565 Bytes::new(__input)
12566 };
12567 let mut __struct = Self::default();
12568 __struct.timestamp = buf.get_u64_le();
12569 __struct.custom_state = buf.get_u64_le();
12570 __struct.lat = buf.get_i32_le();
12571 __struct.lon = buf.get_i32_le();
12572 __struct.alt = buf.get_f32_le();
12573 for v in &mut __struct.vel {
12574 let val = buf.get_f32_le();
12575 *v = val;
12576 }
12577 for v in &mut __struct.acc {
12578 let val = buf.get_f32_le();
12579 *v = val;
12580 }
12581 for v in &mut __struct.attitude_q {
12582 let val = buf.get_f32_le();
12583 *v = val;
12584 }
12585 for v in &mut __struct.rates {
12586 let val = buf.get_f32_le();
12587 *v = val;
12588 }
12589 for v in &mut __struct.position_cov {
12590 let val = buf.get_f32_le();
12591 *v = val;
12592 }
12593 __struct.est_capabilities = buf.get_u8();
12594 Ok(__struct)
12595 }
12596 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12597 let mut __tmp = BytesMut::new(bytes);
12598 #[allow(clippy::absurd_extreme_comparisons)]
12599 #[allow(unused_comparisons)]
12600 if __tmp.remaining() < Self::ENCODED_LEN {
12601 panic!(
12602 "buffer is too small (need {} bytes, but got {})",
12603 Self::ENCODED_LEN,
12604 __tmp.remaining(),
12605 )
12606 }
12607 __tmp.put_u64_le(self.timestamp);
12608 __tmp.put_u64_le(self.custom_state);
12609 __tmp.put_i32_le(self.lat);
12610 __tmp.put_i32_le(self.lon);
12611 __tmp.put_f32_le(self.alt);
12612 for val in &self.vel {
12613 __tmp.put_f32_le(*val);
12614 }
12615 for val in &self.acc {
12616 __tmp.put_f32_le(*val);
12617 }
12618 for val in &self.attitude_q {
12619 __tmp.put_f32_le(*val);
12620 }
12621 for val in &self.rates {
12622 __tmp.put_f32_le(*val);
12623 }
12624 for val in &self.position_cov {
12625 __tmp.put_f32_le(*val);
12626 }
12627 __tmp.put_u8(self.est_capabilities);
12628 if matches!(version, MavlinkVersion::V2) {
12629 let len = __tmp.len();
12630 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12631 } else {
12632 __tmp.len()
12633 }
12634 }
12635}
12636#[doc = "Fuel status. This message provides \"generic\" fuel level information for in a GCS and for triggering failsafes in an autopilot. The fuel type and associated units for fields in this message are defined in the enum MAV_FUEL_TYPE. The reported `consumed_fuel` and `remaining_fuel` must only be supplied if measured: they must not be inferred from the `maximum_fuel` and the other value. A recipient can assume that if these fields are supplied they are accurate. If not provided, the recipient can infer `remaining_fuel` from `maximum_fuel` and `consumed_fuel` on the assumption that the fuel was initially at its maximum (this is what battery monitors assume). Note however that this is an assumption, and the UI should prompt the user appropriately (i.e. notify user that they should fill the tank before boot). This kind of information may also be sent in fuel-specific messages such as BATTERY_STATUS_V2. If both messages are sent for the same fuel system, the ids and corresponding information must match. This should be streamed (nominally at 0.1 Hz)."]
12637#[doc = ""]
12638#[doc = "ID: 371"]
12639#[derive(Debug, Clone, PartialEq)]
12640#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12641#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12642#[cfg_attr(feature = "ts", derive(TS))]
12643#[cfg_attr(feature = "ts", ts(export))]
12644pub struct FUEL_STATUS_DATA {
12645 #[doc = "Capacity when full. Must be provided."]
12646 pub maximum_fuel: f32,
12647 #[doc = "Consumed fuel (measured). This value should not be inferred: if not measured set to NaN. NaN: field not provided."]
12648 pub consumed_fuel: f32,
12649 #[doc = "Remaining fuel until empty (measured). The value should not be inferred: if not measured set to NaN. NaN: field not provided."]
12650 pub remaining_fuel: f32,
12651 #[doc = "Positive value when emptying/using, and negative if filling/replacing. NaN: field not provided."]
12652 pub flow_rate: f32,
12653 #[doc = "Fuel temperature. NaN: field not provided."]
12654 pub temperature: f32,
12655 #[doc = "Fuel type. Defines units for fuel capacity and consumption fields above."]
12656 pub fuel_type: MavFuelType,
12657 #[doc = "Fuel ID. Must match ID of other messages for same fuel system, such as BATTERY_STATUS_V2."]
12658 pub id: u8,
12659 #[doc = "Percentage of remaining fuel, relative to full. Values: [0-100], UINT8_MAX: field not provided."]
12660 pub percent_remaining: u8,
12661}
12662impl FUEL_STATUS_DATA {
12663 pub const ENCODED_LEN: usize = 26usize;
12664 pub const DEFAULT: Self = Self {
12665 maximum_fuel: 0.0_f32,
12666 consumed_fuel: 0.0_f32,
12667 remaining_fuel: 0.0_f32,
12668 flow_rate: 0.0_f32,
12669 temperature: 0.0_f32,
12670 fuel_type: MavFuelType::DEFAULT,
12671 id: 0_u8,
12672 percent_remaining: 0_u8,
12673 };
12674 #[cfg(feature = "arbitrary")]
12675 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12676 use arbitrary::{Arbitrary, Unstructured};
12677 let mut buf = [0u8; 1024];
12678 rng.fill_bytes(&mut buf);
12679 let mut unstructured = Unstructured::new(&buf);
12680 Self::arbitrary(&mut unstructured).unwrap_or_default()
12681 }
12682}
12683impl Default for FUEL_STATUS_DATA {
12684 fn default() -> Self {
12685 Self::DEFAULT.clone()
12686 }
12687}
12688impl MessageData for FUEL_STATUS_DATA {
12689 type Message = MavMessage;
12690 const ID: u32 = 371u32;
12691 const NAME: &'static str = "FUEL_STATUS";
12692 const EXTRA_CRC: u8 = 10u8;
12693 const ENCODED_LEN: usize = 26usize;
12694 fn deser(
12695 _version: MavlinkVersion,
12696 __input: &[u8],
12697 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12698 let avail_len = __input.len();
12699 let mut payload_buf = [0; Self::ENCODED_LEN];
12700 let mut buf = if avail_len < Self::ENCODED_LEN {
12701 payload_buf[0..avail_len].copy_from_slice(__input);
12702 Bytes::new(&payload_buf)
12703 } else {
12704 Bytes::new(__input)
12705 };
12706 let mut __struct = Self::default();
12707 __struct.maximum_fuel = buf.get_f32_le();
12708 __struct.consumed_fuel = buf.get_f32_le();
12709 __struct.remaining_fuel = buf.get_f32_le();
12710 __struct.flow_rate = buf.get_f32_le();
12711 __struct.temperature = buf.get_f32_le();
12712 let tmp = buf.get_u32_le();
12713 __struct.fuel_type = FromPrimitive::from_u32(tmp).ok_or(
12714 ::mavlink_core::error::ParserError::InvalidEnum {
12715 enum_type: "MavFuelType",
12716 value: tmp as u32,
12717 },
12718 )?;
12719 __struct.id = buf.get_u8();
12720 __struct.percent_remaining = buf.get_u8();
12721 Ok(__struct)
12722 }
12723 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12724 let mut __tmp = BytesMut::new(bytes);
12725 #[allow(clippy::absurd_extreme_comparisons)]
12726 #[allow(unused_comparisons)]
12727 if __tmp.remaining() < Self::ENCODED_LEN {
12728 panic!(
12729 "buffer is too small (need {} bytes, but got {})",
12730 Self::ENCODED_LEN,
12731 __tmp.remaining(),
12732 )
12733 }
12734 __tmp.put_f32_le(self.maximum_fuel);
12735 __tmp.put_f32_le(self.consumed_fuel);
12736 __tmp.put_f32_le(self.remaining_fuel);
12737 __tmp.put_f32_le(self.flow_rate);
12738 __tmp.put_f32_le(self.temperature);
12739 __tmp.put_u32_le(self.fuel_type as u32);
12740 __tmp.put_u8(self.id);
12741 __tmp.put_u8(self.percent_remaining);
12742 if matches!(version, MavlinkVersion::V2) {
12743 let len = __tmp.len();
12744 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12745 } else {
12746 __tmp.len()
12747 }
12748 }
12749}
12750#[doc = "Telemetry of power generation system. Alternator or mechanical generator."]
12751#[doc = ""]
12752#[doc = "ID: 373"]
12753#[derive(Debug, Clone, PartialEq)]
12754#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12755#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12756#[cfg_attr(feature = "ts", derive(TS))]
12757#[cfg_attr(feature = "ts", ts(export))]
12758pub struct GENERATOR_STATUS_DATA {
12759 #[doc = "Status flags."]
12760 pub status: MavGeneratorStatusFlag,
12761 #[doc = "Current into/out of battery. Positive for out. Negative for in. NaN: field not provided."]
12762 pub battery_current: f32,
12763 #[doc = "Current going to the UAV. If battery current not available this is the DC current from the generator. Positive for out. Negative for in. NaN: field not provided"]
12764 pub load_current: f32,
12765 #[doc = "The power being generated. NaN: field not provided"]
12766 pub power_generated: f32,
12767 #[doc = "Voltage of the bus seen at the generator, or battery bus if battery bus is controlled by generator and at a different voltage to main bus."]
12768 pub bus_voltage: f32,
12769 #[doc = "The target battery current. Positive for out. Negative for in. NaN: field not provided"]
12770 pub bat_current_setpoint: f32,
12771 #[doc = "Seconds this generator has run since it was rebooted. UINT32_MAX: field not provided."]
12772 pub runtime: u32,
12773 #[doc = "Seconds until this generator requires maintenance. A negative value indicates maintenance is past-due. INT32_MAX: field not provided."]
12774 pub time_until_maintenance: i32,
12775 #[doc = "Speed of electrical generator or alternator. UINT16_MAX: field not provided."]
12776 pub generator_speed: u16,
12777 #[doc = "The temperature of the rectifier or power converter. INT16_MAX: field not provided."]
12778 pub rectifier_temperature: i16,
12779 #[doc = "The temperature of the mechanical motor, fuel cell core or generator. INT16_MAX: field not provided."]
12780 pub generator_temperature: i16,
12781}
12782impl GENERATOR_STATUS_DATA {
12783 pub const ENCODED_LEN: usize = 42usize;
12784 pub const DEFAULT: Self = Self {
12785 status: MavGeneratorStatusFlag::DEFAULT,
12786 battery_current: 0.0_f32,
12787 load_current: 0.0_f32,
12788 power_generated: 0.0_f32,
12789 bus_voltage: 0.0_f32,
12790 bat_current_setpoint: 0.0_f32,
12791 runtime: 0_u32,
12792 time_until_maintenance: 0_i32,
12793 generator_speed: 0_u16,
12794 rectifier_temperature: 0_i16,
12795 generator_temperature: 0_i16,
12796 };
12797 #[cfg(feature = "arbitrary")]
12798 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12799 use arbitrary::{Arbitrary, Unstructured};
12800 let mut buf = [0u8; 1024];
12801 rng.fill_bytes(&mut buf);
12802 let mut unstructured = Unstructured::new(&buf);
12803 Self::arbitrary(&mut unstructured).unwrap_or_default()
12804 }
12805}
12806impl Default for GENERATOR_STATUS_DATA {
12807 fn default() -> Self {
12808 Self::DEFAULT.clone()
12809 }
12810}
12811impl MessageData for GENERATOR_STATUS_DATA {
12812 type Message = MavMessage;
12813 const ID: u32 = 373u32;
12814 const NAME: &'static str = "GENERATOR_STATUS";
12815 const EXTRA_CRC: u8 = 117u8;
12816 const ENCODED_LEN: usize = 42usize;
12817 fn deser(
12818 _version: MavlinkVersion,
12819 __input: &[u8],
12820 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12821 let avail_len = __input.len();
12822 let mut payload_buf = [0; Self::ENCODED_LEN];
12823 let mut buf = if avail_len < Self::ENCODED_LEN {
12824 payload_buf[0..avail_len].copy_from_slice(__input);
12825 Bytes::new(&payload_buf)
12826 } else {
12827 Bytes::new(__input)
12828 };
12829 let mut __struct = Self::default();
12830 let tmp = buf.get_u64_le();
12831 __struct.status = MavGeneratorStatusFlag::from_bits(
12832 tmp & MavGeneratorStatusFlag::all().bits(),
12833 )
12834 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12835 flag_type: "MavGeneratorStatusFlag",
12836 value: tmp as u32,
12837 })?;
12838 __struct.battery_current = buf.get_f32_le();
12839 __struct.load_current = buf.get_f32_le();
12840 __struct.power_generated = buf.get_f32_le();
12841 __struct.bus_voltage = buf.get_f32_le();
12842 __struct.bat_current_setpoint = buf.get_f32_le();
12843 __struct.runtime = buf.get_u32_le();
12844 __struct.time_until_maintenance = buf.get_i32_le();
12845 __struct.generator_speed = buf.get_u16_le();
12846 __struct.rectifier_temperature = buf.get_i16_le();
12847 __struct.generator_temperature = buf.get_i16_le();
12848 Ok(__struct)
12849 }
12850 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12851 let mut __tmp = BytesMut::new(bytes);
12852 #[allow(clippy::absurd_extreme_comparisons)]
12853 #[allow(unused_comparisons)]
12854 if __tmp.remaining() < Self::ENCODED_LEN {
12855 panic!(
12856 "buffer is too small (need {} bytes, but got {})",
12857 Self::ENCODED_LEN,
12858 __tmp.remaining(),
12859 )
12860 }
12861 __tmp.put_u64_le(self.status.bits());
12862 __tmp.put_f32_le(self.battery_current);
12863 __tmp.put_f32_le(self.load_current);
12864 __tmp.put_f32_le(self.power_generated);
12865 __tmp.put_f32_le(self.bus_voltage);
12866 __tmp.put_f32_le(self.bat_current_setpoint);
12867 __tmp.put_u32_le(self.runtime);
12868 __tmp.put_i32_le(self.time_until_maintenance);
12869 __tmp.put_u16_le(self.generator_speed);
12870 __tmp.put_i16_le(self.rectifier_temperature);
12871 __tmp.put_i16_le(self.generator_temperature);
12872 if matches!(version, MavlinkVersion::V2) {
12873 let len = __tmp.len();
12874 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12875 } else {
12876 __tmp.len()
12877 }
12878 }
12879}
12880#[doc = "Message reporting the status of a gimbal device. \t This message should be broadcast by a gimbal device component at a low regular rate (e.g. 5 Hz). \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Other conditions of the flags are not allowed. \t The quaternion and angular velocities in the other frame can be calculated from delta_yaw and delta_yaw_velocity as \t q_earth = q_delta_yaw * q_vehicle and w_earth = w_delta_yaw_velocity + w_vehicle (if not NaN). \t If neither the GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME nor the GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME flag is set, \t then (for backwards compatibility) the data in the delta_yaw and delta_yaw_velocity fields are to be ignored. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME, \t and always should set delta_yaw and delta_yaw_velocity either to the proper value or NaN."]
12881#[doc = ""]
12882#[doc = "ID: 285"]
12883#[derive(Debug, Clone, PartialEq)]
12884#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12885#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12886#[cfg_attr(feature = "ts", derive(TS))]
12887#[cfg_attr(feature = "ts", ts(export))]
12888pub struct GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12889 #[doc = "Timestamp (time since system boot)."]
12890 pub time_boot_ms: u32,
12891 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description."]
12892 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12893 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12894 pub q: [f32; 4],
12895 #[doc = "X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN if unknown."]
12896 pub angular_velocity_x: f32,
12897 #[doc = "Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN if unknown."]
12898 pub angular_velocity_y: f32,
12899 #[doc = "Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN if unknown."]
12900 pub angular_velocity_z: f32,
12901 #[doc = "Failure flags (0 for no failure)"]
12902 pub failure_flags: GimbalDeviceErrorFlags,
12903 #[doc = "Current gimbal flags set."]
12904 pub flags: GimbalDeviceFlags,
12905 #[doc = "System ID"]
12906 pub target_system: u8,
12907 #[doc = "Component ID"]
12908 pub target_component: u8,
12909 #[doc = "Yaw angle relating the quaternions in earth and body frames (see message description). NaN if unknown."]
12910 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12911 pub delta_yaw: f32,
12912 #[doc = "Yaw angular velocity relating the angular velocities in earth and body frames (see message description). NaN if unknown."]
12913 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12914 pub delta_yaw_velocity: f32,
12915 #[doc = "This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set a number between 1-6. If the component ID is separate, this field is not required and must be set to 0."]
12916 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12917 pub gimbal_device_id: u8,
12918}
12919impl GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12920 pub const ENCODED_LEN: usize = 49usize;
12921 pub const DEFAULT: Self = Self {
12922 time_boot_ms: 0_u32,
12923 q: [0.0_f32; 4usize],
12924 angular_velocity_x: 0.0_f32,
12925 angular_velocity_y: 0.0_f32,
12926 angular_velocity_z: 0.0_f32,
12927 failure_flags: GimbalDeviceErrorFlags::DEFAULT,
12928 flags: GimbalDeviceFlags::DEFAULT,
12929 target_system: 0_u8,
12930 target_component: 0_u8,
12931 delta_yaw: 0.0_f32,
12932 delta_yaw_velocity: 0.0_f32,
12933 gimbal_device_id: 0_u8,
12934 };
12935 #[cfg(feature = "arbitrary")]
12936 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12937 use arbitrary::{Arbitrary, Unstructured};
12938 let mut buf = [0u8; 1024];
12939 rng.fill_bytes(&mut buf);
12940 let mut unstructured = Unstructured::new(&buf);
12941 Self::arbitrary(&mut unstructured).unwrap_or_default()
12942 }
12943}
12944impl Default for GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12945 fn default() -> Self {
12946 Self::DEFAULT.clone()
12947 }
12948}
12949impl MessageData for GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12950 type Message = MavMessage;
12951 const ID: u32 = 285u32;
12952 const NAME: &'static str = "GIMBAL_DEVICE_ATTITUDE_STATUS";
12953 const EXTRA_CRC: u8 = 137u8;
12954 const ENCODED_LEN: usize = 49usize;
12955 fn deser(
12956 _version: MavlinkVersion,
12957 __input: &[u8],
12958 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12959 let avail_len = __input.len();
12960 let mut payload_buf = [0; Self::ENCODED_LEN];
12961 let mut buf = if avail_len < Self::ENCODED_LEN {
12962 payload_buf[0..avail_len].copy_from_slice(__input);
12963 Bytes::new(&payload_buf)
12964 } else {
12965 Bytes::new(__input)
12966 };
12967 let mut __struct = Self::default();
12968 __struct.time_boot_ms = buf.get_u32_le();
12969 for v in &mut __struct.q {
12970 let val = buf.get_f32_le();
12971 *v = val;
12972 }
12973 __struct.angular_velocity_x = buf.get_f32_le();
12974 __struct.angular_velocity_y = buf.get_f32_le();
12975 __struct.angular_velocity_z = buf.get_f32_le();
12976 let tmp = buf.get_u32_le();
12977 __struct.failure_flags = GimbalDeviceErrorFlags::from_bits(
12978 tmp & GimbalDeviceErrorFlags::all().bits(),
12979 )
12980 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12981 flag_type: "GimbalDeviceErrorFlags",
12982 value: tmp as u32,
12983 })?;
12984 let tmp = buf.get_u16_le();
12985 __struct.flags = GimbalDeviceFlags::from_bits(tmp & GimbalDeviceFlags::all().bits())
12986 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12987 flag_type: "GimbalDeviceFlags",
12988 value: tmp as u32,
12989 })?;
12990 __struct.target_system = buf.get_u8();
12991 __struct.target_component = buf.get_u8();
12992 __struct.delta_yaw = buf.get_f32_le();
12993 __struct.delta_yaw_velocity = buf.get_f32_le();
12994 __struct.gimbal_device_id = buf.get_u8();
12995 Ok(__struct)
12996 }
12997 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12998 let mut __tmp = BytesMut::new(bytes);
12999 #[allow(clippy::absurd_extreme_comparisons)]
13000 #[allow(unused_comparisons)]
13001 if __tmp.remaining() < Self::ENCODED_LEN {
13002 panic!(
13003 "buffer is too small (need {} bytes, but got {})",
13004 Self::ENCODED_LEN,
13005 __tmp.remaining(),
13006 )
13007 }
13008 __tmp.put_u32_le(self.time_boot_ms);
13009 for val in &self.q {
13010 __tmp.put_f32_le(*val);
13011 }
13012 __tmp.put_f32_le(self.angular_velocity_x);
13013 __tmp.put_f32_le(self.angular_velocity_y);
13014 __tmp.put_f32_le(self.angular_velocity_z);
13015 __tmp.put_u32_le(self.failure_flags.bits());
13016 __tmp.put_u16_le(self.flags.bits());
13017 __tmp.put_u8(self.target_system);
13018 __tmp.put_u8(self.target_component);
13019 if matches!(version, MavlinkVersion::V2) {
13020 __tmp.put_f32_le(self.delta_yaw);
13021 __tmp.put_f32_le(self.delta_yaw_velocity);
13022 __tmp.put_u8(self.gimbal_device_id);
13023 let len = __tmp.len();
13024 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13025 } else {
13026 __tmp.len()
13027 }
13028 }
13029}
13030#[doc = "Information about a low level gimbal. This message should be requested by the gimbal manager or a ground station using MAV_CMD_REQUEST_MESSAGE. The maximum angles and rates are the limits by hardware. However, the limits by software used are likely different/smaller and dependent on mode/settings/etc.."]
13031#[doc = ""]
13032#[doc = "ID: 283"]
13033#[derive(Debug, Clone, PartialEq)]
13034#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13035#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13036#[cfg_attr(feature = "ts", derive(TS))]
13037#[cfg_attr(feature = "ts", ts(export))]
13038pub struct GIMBAL_DEVICE_INFORMATION_DATA {
13039 #[doc = "UID of gimbal hardware (0 if unknown)."]
13040 pub uid: u64,
13041 #[doc = "Timestamp (time since system boot)."]
13042 pub time_boot_ms: u32,
13043 #[doc = "0xff)."]
13044 pub firmware_version: u32,
13045 #[doc = "0xff)."]
13046 pub hardware_version: u32,
13047 #[doc = "Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown."]
13048 pub roll_min: f32,
13049 #[doc = "Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown."]
13050 pub roll_max: f32,
13051 #[doc = "Minimum hardware pitch angle (positive: up, negative: down). NAN if unknown."]
13052 pub pitch_min: f32,
13053 #[doc = "Maximum hardware pitch angle (positive: up, negative: down). NAN if unknown."]
13054 pub pitch_max: f32,
13055 #[doc = "Minimum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown."]
13056 pub yaw_min: f32,
13057 #[doc = "Maximum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown."]
13058 pub yaw_max: f32,
13059 #[doc = "Bitmap of gimbal capability flags."]
13060 pub cap_flags: GimbalDeviceCapFlags,
13061 #[doc = "Bitmap for use for gimbal-specific capability flags."]
13062 pub custom_cap_flags: u16,
13063 #[doc = "Name of the gimbal vendor."]
13064 #[cfg_attr(
13065 feature = "serde",
13066 serde(
13067 serialize_with = "crate::nulstr::serialize::<_, 32>",
13068 deserialize_with = "crate::nulstr::deserialize::<_, 32>"
13069 )
13070 )]
13071 #[cfg_attr(feature = "ts", ts(type = "string"))]
13072 pub vendor_name: [u8; 32],
13073 #[doc = "Name of the gimbal model."]
13074 #[cfg_attr(
13075 feature = "serde",
13076 serde(
13077 serialize_with = "crate::nulstr::serialize::<_, 32>",
13078 deserialize_with = "crate::nulstr::deserialize::<_, 32>"
13079 )
13080 )]
13081 #[cfg_attr(feature = "ts", ts(type = "string"))]
13082 pub model_name: [u8; 32],
13083 #[doc = "Custom name of the gimbal given to it by the user."]
13084 #[cfg_attr(
13085 feature = "serde",
13086 serde(
13087 serialize_with = "crate::nulstr::serialize::<_, 32>",
13088 deserialize_with = "crate::nulstr::deserialize::<_, 32>"
13089 )
13090 )]
13091 #[cfg_attr(feature = "ts", ts(type = "string"))]
13092 pub custom_name: [u8; 32],
13093 #[doc = "This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set to a number between 1-6. If the component ID is separate, this field is not required and must be set to 0."]
13094 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13095 pub gimbal_device_id: u8,
13096}
13097impl GIMBAL_DEVICE_INFORMATION_DATA {
13098 pub const ENCODED_LEN: usize = 145usize;
13099 pub const DEFAULT: Self = Self {
13100 uid: 0_u64,
13101 time_boot_ms: 0_u32,
13102 firmware_version: 0_u32,
13103 hardware_version: 0_u32,
13104 roll_min: 0.0_f32,
13105 roll_max: 0.0_f32,
13106 pitch_min: 0.0_f32,
13107 pitch_max: 0.0_f32,
13108 yaw_min: 0.0_f32,
13109 yaw_max: 0.0_f32,
13110 cap_flags: GimbalDeviceCapFlags::DEFAULT,
13111 custom_cap_flags: 0_u16,
13112 vendor_name: [0_u8; 32usize],
13113 model_name: [0_u8; 32usize],
13114 custom_name: [0_u8; 32usize],
13115 gimbal_device_id: 0_u8,
13116 };
13117 #[cfg(feature = "arbitrary")]
13118 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13119 use arbitrary::{Arbitrary, Unstructured};
13120 let mut buf = [0u8; 1024];
13121 rng.fill_bytes(&mut buf);
13122 let mut unstructured = Unstructured::new(&buf);
13123 Self::arbitrary(&mut unstructured).unwrap_or_default()
13124 }
13125}
13126impl Default for GIMBAL_DEVICE_INFORMATION_DATA {
13127 fn default() -> Self {
13128 Self::DEFAULT.clone()
13129 }
13130}
13131impl MessageData for GIMBAL_DEVICE_INFORMATION_DATA {
13132 type Message = MavMessage;
13133 const ID: u32 = 283u32;
13134 const NAME: &'static str = "GIMBAL_DEVICE_INFORMATION";
13135 const EXTRA_CRC: u8 = 74u8;
13136 const ENCODED_LEN: usize = 145usize;
13137 fn deser(
13138 _version: MavlinkVersion,
13139 __input: &[u8],
13140 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13141 let avail_len = __input.len();
13142 let mut payload_buf = [0; Self::ENCODED_LEN];
13143 let mut buf = if avail_len < Self::ENCODED_LEN {
13144 payload_buf[0..avail_len].copy_from_slice(__input);
13145 Bytes::new(&payload_buf)
13146 } else {
13147 Bytes::new(__input)
13148 };
13149 let mut __struct = Self::default();
13150 __struct.uid = buf.get_u64_le();
13151 __struct.time_boot_ms = buf.get_u32_le();
13152 __struct.firmware_version = buf.get_u32_le();
13153 __struct.hardware_version = buf.get_u32_le();
13154 __struct.roll_min = buf.get_f32_le();
13155 __struct.roll_max = buf.get_f32_le();
13156 __struct.pitch_min = buf.get_f32_le();
13157 __struct.pitch_max = buf.get_f32_le();
13158 __struct.yaw_min = buf.get_f32_le();
13159 __struct.yaw_max = buf.get_f32_le();
13160 let tmp = buf.get_u16_le();
13161 __struct.cap_flags = GimbalDeviceCapFlags::from_bits(
13162 tmp & GimbalDeviceCapFlags::all().bits(),
13163 )
13164 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13165 flag_type: "GimbalDeviceCapFlags",
13166 value: tmp as u32,
13167 })?;
13168 __struct.custom_cap_flags = buf.get_u16_le();
13169 for v in &mut __struct.vendor_name {
13170 let val = buf.get_u8();
13171 *v = val;
13172 }
13173 for v in &mut __struct.model_name {
13174 let val = buf.get_u8();
13175 *v = val;
13176 }
13177 for v in &mut __struct.custom_name {
13178 let val = buf.get_u8();
13179 *v = val;
13180 }
13181 __struct.gimbal_device_id = buf.get_u8();
13182 Ok(__struct)
13183 }
13184 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13185 let mut __tmp = BytesMut::new(bytes);
13186 #[allow(clippy::absurd_extreme_comparisons)]
13187 #[allow(unused_comparisons)]
13188 if __tmp.remaining() < Self::ENCODED_LEN {
13189 panic!(
13190 "buffer is too small (need {} bytes, but got {})",
13191 Self::ENCODED_LEN,
13192 __tmp.remaining(),
13193 )
13194 }
13195 __tmp.put_u64_le(self.uid);
13196 __tmp.put_u32_le(self.time_boot_ms);
13197 __tmp.put_u32_le(self.firmware_version);
13198 __tmp.put_u32_le(self.hardware_version);
13199 __tmp.put_f32_le(self.roll_min);
13200 __tmp.put_f32_le(self.roll_max);
13201 __tmp.put_f32_le(self.pitch_min);
13202 __tmp.put_f32_le(self.pitch_max);
13203 __tmp.put_f32_le(self.yaw_min);
13204 __tmp.put_f32_le(self.yaw_max);
13205 __tmp.put_u16_le(self.cap_flags.bits());
13206 __tmp.put_u16_le(self.custom_cap_flags);
13207 for val in &self.vendor_name {
13208 __tmp.put_u8(*val);
13209 }
13210 for val in &self.model_name {
13211 __tmp.put_u8(*val);
13212 }
13213 for val in &self.custom_name {
13214 __tmp.put_u8(*val);
13215 }
13216 if matches!(version, MavlinkVersion::V2) {
13217 __tmp.put_u8(self.gimbal_device_id);
13218 let len = __tmp.len();
13219 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13220 } else {
13221 __tmp.len()
13222 }
13223 }
13224}
13225#[doc = "Low level message to control a gimbal device's attitude. \t This message is to be sent from the gimbal manager to the gimbal device component. \t The quaternion and angular velocities can be set to NaN according to use case. \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Setting both GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME and GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is not allowed. \t These rules are to ensure backwards compatibility. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."]
13226#[doc = ""]
13227#[doc = "ID: 284"]
13228#[derive(Debug, Clone, PartialEq)]
13229#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13230#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13231#[cfg_attr(feature = "ts", derive(TS))]
13232#[cfg_attr(feature = "ts", ts(export))]
13233pub struct GIMBAL_DEVICE_SET_ATTITUDE_DATA {
13234 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description. Set fields to NaN to be ignored."]
13235 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13236 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
13237 pub q: [f32; 4],
13238 #[doc = "X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN to be ignored."]
13239 pub angular_velocity_x: f32,
13240 #[doc = "Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN to be ignored."]
13241 pub angular_velocity_y: f32,
13242 #[doc = "Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN to be ignored."]
13243 pub angular_velocity_z: f32,
13244 #[doc = "Low level gimbal flags."]
13245 pub flags: GimbalDeviceFlags,
13246 #[doc = "System ID"]
13247 pub target_system: u8,
13248 #[doc = "Component ID"]
13249 pub target_component: u8,
13250}
13251impl GIMBAL_DEVICE_SET_ATTITUDE_DATA {
13252 pub const ENCODED_LEN: usize = 32usize;
13253 pub const DEFAULT: Self = Self {
13254 q: [0.0_f32; 4usize],
13255 angular_velocity_x: 0.0_f32,
13256 angular_velocity_y: 0.0_f32,
13257 angular_velocity_z: 0.0_f32,
13258 flags: GimbalDeviceFlags::DEFAULT,
13259 target_system: 0_u8,
13260 target_component: 0_u8,
13261 };
13262 #[cfg(feature = "arbitrary")]
13263 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13264 use arbitrary::{Arbitrary, Unstructured};
13265 let mut buf = [0u8; 1024];
13266 rng.fill_bytes(&mut buf);
13267 let mut unstructured = Unstructured::new(&buf);
13268 Self::arbitrary(&mut unstructured).unwrap_or_default()
13269 }
13270}
13271impl Default for GIMBAL_DEVICE_SET_ATTITUDE_DATA {
13272 fn default() -> Self {
13273 Self::DEFAULT.clone()
13274 }
13275}
13276impl MessageData for GIMBAL_DEVICE_SET_ATTITUDE_DATA {
13277 type Message = MavMessage;
13278 const ID: u32 = 284u32;
13279 const NAME: &'static str = "GIMBAL_DEVICE_SET_ATTITUDE";
13280 const EXTRA_CRC: u8 = 99u8;
13281 const ENCODED_LEN: usize = 32usize;
13282 fn deser(
13283 _version: MavlinkVersion,
13284 __input: &[u8],
13285 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13286 let avail_len = __input.len();
13287 let mut payload_buf = [0; Self::ENCODED_LEN];
13288 let mut buf = if avail_len < Self::ENCODED_LEN {
13289 payload_buf[0..avail_len].copy_from_slice(__input);
13290 Bytes::new(&payload_buf)
13291 } else {
13292 Bytes::new(__input)
13293 };
13294 let mut __struct = Self::default();
13295 for v in &mut __struct.q {
13296 let val = buf.get_f32_le();
13297 *v = val;
13298 }
13299 __struct.angular_velocity_x = buf.get_f32_le();
13300 __struct.angular_velocity_y = buf.get_f32_le();
13301 __struct.angular_velocity_z = buf.get_f32_le();
13302 let tmp = buf.get_u16_le();
13303 __struct.flags = GimbalDeviceFlags::from_bits(tmp & GimbalDeviceFlags::all().bits())
13304 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13305 flag_type: "GimbalDeviceFlags",
13306 value: tmp as u32,
13307 })?;
13308 __struct.target_system = buf.get_u8();
13309 __struct.target_component = buf.get_u8();
13310 Ok(__struct)
13311 }
13312 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13313 let mut __tmp = BytesMut::new(bytes);
13314 #[allow(clippy::absurd_extreme_comparisons)]
13315 #[allow(unused_comparisons)]
13316 if __tmp.remaining() < Self::ENCODED_LEN {
13317 panic!(
13318 "buffer is too small (need {} bytes, but got {})",
13319 Self::ENCODED_LEN,
13320 __tmp.remaining(),
13321 )
13322 }
13323 for val in &self.q {
13324 __tmp.put_f32_le(*val);
13325 }
13326 __tmp.put_f32_le(self.angular_velocity_x);
13327 __tmp.put_f32_le(self.angular_velocity_y);
13328 __tmp.put_f32_le(self.angular_velocity_z);
13329 __tmp.put_u16_le(self.flags.bits());
13330 __tmp.put_u8(self.target_system);
13331 __tmp.put_u8(self.target_component);
13332 if matches!(version, MavlinkVersion::V2) {
13333 let len = __tmp.len();
13334 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13335 } else {
13336 __tmp.len()
13337 }
13338 }
13339}
13340#[doc = "Information about a high level gimbal manager. This message should be requested by a ground station using MAV_CMD_REQUEST_MESSAGE."]
13341#[doc = ""]
13342#[doc = "ID: 280"]
13343#[derive(Debug, Clone, PartialEq)]
13344#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13345#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13346#[cfg_attr(feature = "ts", derive(TS))]
13347#[cfg_attr(feature = "ts", ts(export))]
13348pub struct GIMBAL_MANAGER_INFORMATION_DATA {
13349 #[doc = "Timestamp (time since system boot)."]
13350 pub time_boot_ms: u32,
13351 #[doc = "Bitmap of gimbal capability flags."]
13352 pub cap_flags: GimbalManagerCapFlags,
13353 #[doc = "Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left)"]
13354 pub roll_min: f32,
13355 #[doc = "Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left)"]
13356 pub roll_max: f32,
13357 #[doc = "Minimum pitch angle (positive: up, negative: down)"]
13358 pub pitch_min: f32,
13359 #[doc = "Maximum pitch angle (positive: up, negative: down)"]
13360 pub pitch_max: f32,
13361 #[doc = "Minimum yaw angle (positive: to the right, negative: to the left)"]
13362 pub yaw_min: f32,
13363 #[doc = "Maximum yaw angle (positive: to the right, negative: to the left)"]
13364 pub yaw_max: f32,
13365 #[doc = "Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal)."]
13366 pub gimbal_device_id: u8,
13367}
13368impl GIMBAL_MANAGER_INFORMATION_DATA {
13369 pub const ENCODED_LEN: usize = 33usize;
13370 pub const DEFAULT: Self = Self {
13371 time_boot_ms: 0_u32,
13372 cap_flags: GimbalManagerCapFlags::DEFAULT,
13373 roll_min: 0.0_f32,
13374 roll_max: 0.0_f32,
13375 pitch_min: 0.0_f32,
13376 pitch_max: 0.0_f32,
13377 yaw_min: 0.0_f32,
13378 yaw_max: 0.0_f32,
13379 gimbal_device_id: 0_u8,
13380 };
13381 #[cfg(feature = "arbitrary")]
13382 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13383 use arbitrary::{Arbitrary, Unstructured};
13384 let mut buf = [0u8; 1024];
13385 rng.fill_bytes(&mut buf);
13386 let mut unstructured = Unstructured::new(&buf);
13387 Self::arbitrary(&mut unstructured).unwrap_or_default()
13388 }
13389}
13390impl Default for GIMBAL_MANAGER_INFORMATION_DATA {
13391 fn default() -> Self {
13392 Self::DEFAULT.clone()
13393 }
13394}
13395impl MessageData for GIMBAL_MANAGER_INFORMATION_DATA {
13396 type Message = MavMessage;
13397 const ID: u32 = 280u32;
13398 const NAME: &'static str = "GIMBAL_MANAGER_INFORMATION";
13399 const EXTRA_CRC: u8 = 70u8;
13400 const ENCODED_LEN: usize = 33usize;
13401 fn deser(
13402 _version: MavlinkVersion,
13403 __input: &[u8],
13404 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13405 let avail_len = __input.len();
13406 let mut payload_buf = [0; Self::ENCODED_LEN];
13407 let mut buf = if avail_len < Self::ENCODED_LEN {
13408 payload_buf[0..avail_len].copy_from_slice(__input);
13409 Bytes::new(&payload_buf)
13410 } else {
13411 Bytes::new(__input)
13412 };
13413 let mut __struct = Self::default();
13414 __struct.time_boot_ms = buf.get_u32_le();
13415 let tmp = buf.get_u32_le();
13416 __struct.cap_flags = GimbalManagerCapFlags::from_bits(
13417 tmp & GimbalManagerCapFlags::all().bits(),
13418 )
13419 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13420 flag_type: "GimbalManagerCapFlags",
13421 value: tmp as u32,
13422 })?;
13423 __struct.roll_min = buf.get_f32_le();
13424 __struct.roll_max = buf.get_f32_le();
13425 __struct.pitch_min = buf.get_f32_le();
13426 __struct.pitch_max = buf.get_f32_le();
13427 __struct.yaw_min = buf.get_f32_le();
13428 __struct.yaw_max = buf.get_f32_le();
13429 __struct.gimbal_device_id = buf.get_u8();
13430 Ok(__struct)
13431 }
13432 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13433 let mut __tmp = BytesMut::new(bytes);
13434 #[allow(clippy::absurd_extreme_comparisons)]
13435 #[allow(unused_comparisons)]
13436 if __tmp.remaining() < Self::ENCODED_LEN {
13437 panic!(
13438 "buffer is too small (need {} bytes, but got {})",
13439 Self::ENCODED_LEN,
13440 __tmp.remaining(),
13441 )
13442 }
13443 __tmp.put_u32_le(self.time_boot_ms);
13444 __tmp.put_u32_le(self.cap_flags.bits());
13445 __tmp.put_f32_le(self.roll_min);
13446 __tmp.put_f32_le(self.roll_max);
13447 __tmp.put_f32_le(self.pitch_min);
13448 __tmp.put_f32_le(self.pitch_max);
13449 __tmp.put_f32_le(self.yaw_min);
13450 __tmp.put_f32_le(self.yaw_max);
13451 __tmp.put_u8(self.gimbal_device_id);
13452 if matches!(version, MavlinkVersion::V2) {
13453 let len = __tmp.len();
13454 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13455 } else {
13456 __tmp.len()
13457 }
13458 }
13459}
13460#[doc = "High level message to control a gimbal's attitude. This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
13461#[doc = ""]
13462#[doc = "ID: 282"]
13463#[derive(Debug, Clone, PartialEq)]
13464#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13465#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13466#[cfg_attr(feature = "ts", derive(TS))]
13467#[cfg_attr(feature = "ts", ts(export))]
13468pub struct GIMBAL_MANAGER_SET_ATTITUDE_DATA {
13469 #[doc = "High level gimbal manager flags to use."]
13470 pub flags: GimbalManagerFlags,
13471 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation, the frame is depends on whether the flag GIMBAL_MANAGER_FLAGS_YAW_LOCK is set)"]
13472 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13473 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
13474 pub q: [f32; 4],
13475 #[doc = "X component of angular velocity, positive is rolling to the right, NaN to be ignored."]
13476 pub angular_velocity_x: f32,
13477 #[doc = "Y component of angular velocity, positive is pitching up, NaN to be ignored."]
13478 pub angular_velocity_y: f32,
13479 #[doc = "Z component of angular velocity, positive is yawing to the right, NaN to be ignored."]
13480 pub angular_velocity_z: f32,
13481 #[doc = "System ID"]
13482 pub target_system: u8,
13483 #[doc = "Component ID"]
13484 pub target_component: u8,
13485 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
13486 pub gimbal_device_id: u8,
13487}
13488impl GIMBAL_MANAGER_SET_ATTITUDE_DATA {
13489 pub const ENCODED_LEN: usize = 35usize;
13490 pub const DEFAULT: Self = Self {
13491 flags: GimbalManagerFlags::DEFAULT,
13492 q: [0.0_f32; 4usize],
13493 angular_velocity_x: 0.0_f32,
13494 angular_velocity_y: 0.0_f32,
13495 angular_velocity_z: 0.0_f32,
13496 target_system: 0_u8,
13497 target_component: 0_u8,
13498 gimbal_device_id: 0_u8,
13499 };
13500 #[cfg(feature = "arbitrary")]
13501 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13502 use arbitrary::{Arbitrary, Unstructured};
13503 let mut buf = [0u8; 1024];
13504 rng.fill_bytes(&mut buf);
13505 let mut unstructured = Unstructured::new(&buf);
13506 Self::arbitrary(&mut unstructured).unwrap_or_default()
13507 }
13508}
13509impl Default for GIMBAL_MANAGER_SET_ATTITUDE_DATA {
13510 fn default() -> Self {
13511 Self::DEFAULT.clone()
13512 }
13513}
13514impl MessageData for GIMBAL_MANAGER_SET_ATTITUDE_DATA {
13515 type Message = MavMessage;
13516 const ID: u32 = 282u32;
13517 const NAME: &'static str = "GIMBAL_MANAGER_SET_ATTITUDE";
13518 const EXTRA_CRC: u8 = 123u8;
13519 const ENCODED_LEN: usize = 35usize;
13520 fn deser(
13521 _version: MavlinkVersion,
13522 __input: &[u8],
13523 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13524 let avail_len = __input.len();
13525 let mut payload_buf = [0; Self::ENCODED_LEN];
13526 let mut buf = if avail_len < Self::ENCODED_LEN {
13527 payload_buf[0..avail_len].copy_from_slice(__input);
13528 Bytes::new(&payload_buf)
13529 } else {
13530 Bytes::new(__input)
13531 };
13532 let mut __struct = Self::default();
13533 let tmp = buf.get_u32_le();
13534 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
13535 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13536 flag_type: "GimbalManagerFlags",
13537 value: tmp as u32,
13538 })?;
13539 for v in &mut __struct.q {
13540 let val = buf.get_f32_le();
13541 *v = val;
13542 }
13543 __struct.angular_velocity_x = buf.get_f32_le();
13544 __struct.angular_velocity_y = buf.get_f32_le();
13545 __struct.angular_velocity_z = buf.get_f32_le();
13546 __struct.target_system = buf.get_u8();
13547 __struct.target_component = buf.get_u8();
13548 __struct.gimbal_device_id = buf.get_u8();
13549 Ok(__struct)
13550 }
13551 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13552 let mut __tmp = BytesMut::new(bytes);
13553 #[allow(clippy::absurd_extreme_comparisons)]
13554 #[allow(unused_comparisons)]
13555 if __tmp.remaining() < Self::ENCODED_LEN {
13556 panic!(
13557 "buffer is too small (need {} bytes, but got {})",
13558 Self::ENCODED_LEN,
13559 __tmp.remaining(),
13560 )
13561 }
13562 __tmp.put_u32_le(self.flags.bits());
13563 for val in &self.q {
13564 __tmp.put_f32_le(*val);
13565 }
13566 __tmp.put_f32_le(self.angular_velocity_x);
13567 __tmp.put_f32_le(self.angular_velocity_y);
13568 __tmp.put_f32_le(self.angular_velocity_z);
13569 __tmp.put_u8(self.target_system);
13570 __tmp.put_u8(self.target_component);
13571 __tmp.put_u8(self.gimbal_device_id);
13572 if matches!(version, MavlinkVersion::V2) {
13573 let len = __tmp.len();
13574 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13575 } else {
13576 __tmp.len()
13577 }
13578 }
13579}
13580#[doc = "High level message to control a gimbal manually. The angles or angular rates are unitless; the actual rates will depend on internal gimbal manager settings/configuration (e.g. set by parameters). This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
13581#[doc = ""]
13582#[doc = "ID: 288"]
13583#[derive(Debug, Clone, PartialEq)]
13584#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13585#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13586#[cfg_attr(feature = "ts", derive(TS))]
13587#[cfg_attr(feature = "ts", ts(export))]
13588pub struct GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
13589 #[doc = "High level gimbal manager flags."]
13590 pub flags: GimbalManagerFlags,
13591 #[doc = "Pitch angle unitless (-1..1, positive: up, negative: down, NaN to be ignored)."]
13592 pub pitch: f32,
13593 #[doc = "Yaw angle unitless (-1..1, positive: to the right, negative: to the left, NaN to be ignored)."]
13594 pub yaw: f32,
13595 #[doc = "Pitch angular rate unitless (-1..1, positive: up, negative: down, NaN to be ignored)."]
13596 pub pitch_rate: f32,
13597 #[doc = "Yaw angular rate unitless (-1..1, positive: to the right, negative: to the left, NaN to be ignored)."]
13598 pub yaw_rate: f32,
13599 #[doc = "System ID"]
13600 pub target_system: u8,
13601 #[doc = "Component ID"]
13602 pub target_component: u8,
13603 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
13604 pub gimbal_device_id: u8,
13605}
13606impl GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
13607 pub const ENCODED_LEN: usize = 23usize;
13608 pub const DEFAULT: Self = Self {
13609 flags: GimbalManagerFlags::DEFAULT,
13610 pitch: 0.0_f32,
13611 yaw: 0.0_f32,
13612 pitch_rate: 0.0_f32,
13613 yaw_rate: 0.0_f32,
13614 target_system: 0_u8,
13615 target_component: 0_u8,
13616 gimbal_device_id: 0_u8,
13617 };
13618 #[cfg(feature = "arbitrary")]
13619 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13620 use arbitrary::{Arbitrary, Unstructured};
13621 let mut buf = [0u8; 1024];
13622 rng.fill_bytes(&mut buf);
13623 let mut unstructured = Unstructured::new(&buf);
13624 Self::arbitrary(&mut unstructured).unwrap_or_default()
13625 }
13626}
13627impl Default for GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
13628 fn default() -> Self {
13629 Self::DEFAULT.clone()
13630 }
13631}
13632impl MessageData for GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
13633 type Message = MavMessage;
13634 const ID: u32 = 288u32;
13635 const NAME: &'static str = "GIMBAL_MANAGER_SET_MANUAL_CONTROL";
13636 const EXTRA_CRC: u8 = 20u8;
13637 const ENCODED_LEN: usize = 23usize;
13638 fn deser(
13639 _version: MavlinkVersion,
13640 __input: &[u8],
13641 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13642 let avail_len = __input.len();
13643 let mut payload_buf = [0; Self::ENCODED_LEN];
13644 let mut buf = if avail_len < Self::ENCODED_LEN {
13645 payload_buf[0..avail_len].copy_from_slice(__input);
13646 Bytes::new(&payload_buf)
13647 } else {
13648 Bytes::new(__input)
13649 };
13650 let mut __struct = Self::default();
13651 let tmp = buf.get_u32_le();
13652 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
13653 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13654 flag_type: "GimbalManagerFlags",
13655 value: tmp as u32,
13656 })?;
13657 __struct.pitch = buf.get_f32_le();
13658 __struct.yaw = buf.get_f32_le();
13659 __struct.pitch_rate = buf.get_f32_le();
13660 __struct.yaw_rate = buf.get_f32_le();
13661 __struct.target_system = buf.get_u8();
13662 __struct.target_component = buf.get_u8();
13663 __struct.gimbal_device_id = buf.get_u8();
13664 Ok(__struct)
13665 }
13666 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13667 let mut __tmp = BytesMut::new(bytes);
13668 #[allow(clippy::absurd_extreme_comparisons)]
13669 #[allow(unused_comparisons)]
13670 if __tmp.remaining() < Self::ENCODED_LEN {
13671 panic!(
13672 "buffer is too small (need {} bytes, but got {})",
13673 Self::ENCODED_LEN,
13674 __tmp.remaining(),
13675 )
13676 }
13677 __tmp.put_u32_le(self.flags.bits());
13678 __tmp.put_f32_le(self.pitch);
13679 __tmp.put_f32_le(self.yaw);
13680 __tmp.put_f32_le(self.pitch_rate);
13681 __tmp.put_f32_le(self.yaw_rate);
13682 __tmp.put_u8(self.target_system);
13683 __tmp.put_u8(self.target_component);
13684 __tmp.put_u8(self.gimbal_device_id);
13685 if matches!(version, MavlinkVersion::V2) {
13686 let len = __tmp.len();
13687 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13688 } else {
13689 __tmp.len()
13690 }
13691 }
13692}
13693#[doc = "Set gimbal manager pitch and yaw angles (high rate message). This message is to be sent to the gimbal manager (e.g. from a ground station) and will be ignored by gimbal devices. Angles and rates can be set to NaN according to use case. Use MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW for low-rate adjustments that require confirmation."]
13694#[doc = ""]
13695#[doc = "ID: 287"]
13696#[derive(Debug, Clone, PartialEq)]
13697#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13698#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13699#[cfg_attr(feature = "ts", derive(TS))]
13700#[cfg_attr(feature = "ts", ts(export))]
13701pub struct GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13702 #[doc = "High level gimbal manager flags to use."]
13703 pub flags: GimbalManagerFlags,
13704 #[doc = "Pitch angle (positive: up, negative: down, NaN to be ignored)."]
13705 pub pitch: f32,
13706 #[doc = "Yaw angle (positive: to the right, negative: to the left, NaN to be ignored)."]
13707 pub yaw: f32,
13708 #[doc = "Pitch angular rate (positive: up, negative: down, NaN to be ignored)."]
13709 pub pitch_rate: f32,
13710 #[doc = "Yaw angular rate (positive: to the right, negative: to the left, NaN to be ignored)."]
13711 pub yaw_rate: f32,
13712 #[doc = "System ID"]
13713 pub target_system: u8,
13714 #[doc = "Component ID"]
13715 pub target_component: u8,
13716 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
13717 pub gimbal_device_id: u8,
13718}
13719impl GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13720 pub const ENCODED_LEN: usize = 23usize;
13721 pub const DEFAULT: Self = Self {
13722 flags: GimbalManagerFlags::DEFAULT,
13723 pitch: 0.0_f32,
13724 yaw: 0.0_f32,
13725 pitch_rate: 0.0_f32,
13726 yaw_rate: 0.0_f32,
13727 target_system: 0_u8,
13728 target_component: 0_u8,
13729 gimbal_device_id: 0_u8,
13730 };
13731 #[cfg(feature = "arbitrary")]
13732 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13733 use arbitrary::{Arbitrary, Unstructured};
13734 let mut buf = [0u8; 1024];
13735 rng.fill_bytes(&mut buf);
13736 let mut unstructured = Unstructured::new(&buf);
13737 Self::arbitrary(&mut unstructured).unwrap_or_default()
13738 }
13739}
13740impl Default for GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13741 fn default() -> Self {
13742 Self::DEFAULT.clone()
13743 }
13744}
13745impl MessageData for GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13746 type Message = MavMessage;
13747 const ID: u32 = 287u32;
13748 const NAME: &'static str = "GIMBAL_MANAGER_SET_PITCHYAW";
13749 const EXTRA_CRC: u8 = 1u8;
13750 const ENCODED_LEN: usize = 23usize;
13751 fn deser(
13752 _version: MavlinkVersion,
13753 __input: &[u8],
13754 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13755 let avail_len = __input.len();
13756 let mut payload_buf = [0; Self::ENCODED_LEN];
13757 let mut buf = if avail_len < Self::ENCODED_LEN {
13758 payload_buf[0..avail_len].copy_from_slice(__input);
13759 Bytes::new(&payload_buf)
13760 } else {
13761 Bytes::new(__input)
13762 };
13763 let mut __struct = Self::default();
13764 let tmp = buf.get_u32_le();
13765 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
13766 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13767 flag_type: "GimbalManagerFlags",
13768 value: tmp as u32,
13769 })?;
13770 __struct.pitch = buf.get_f32_le();
13771 __struct.yaw = buf.get_f32_le();
13772 __struct.pitch_rate = buf.get_f32_le();
13773 __struct.yaw_rate = buf.get_f32_le();
13774 __struct.target_system = buf.get_u8();
13775 __struct.target_component = buf.get_u8();
13776 __struct.gimbal_device_id = buf.get_u8();
13777 Ok(__struct)
13778 }
13779 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13780 let mut __tmp = BytesMut::new(bytes);
13781 #[allow(clippy::absurd_extreme_comparisons)]
13782 #[allow(unused_comparisons)]
13783 if __tmp.remaining() < Self::ENCODED_LEN {
13784 panic!(
13785 "buffer is too small (need {} bytes, but got {})",
13786 Self::ENCODED_LEN,
13787 __tmp.remaining(),
13788 )
13789 }
13790 __tmp.put_u32_le(self.flags.bits());
13791 __tmp.put_f32_le(self.pitch);
13792 __tmp.put_f32_le(self.yaw);
13793 __tmp.put_f32_le(self.pitch_rate);
13794 __tmp.put_f32_le(self.yaw_rate);
13795 __tmp.put_u8(self.target_system);
13796 __tmp.put_u8(self.target_component);
13797 __tmp.put_u8(self.gimbal_device_id);
13798 if matches!(version, MavlinkVersion::V2) {
13799 let len = __tmp.len();
13800 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13801 } else {
13802 __tmp.len()
13803 }
13804 }
13805}
13806#[doc = "Current status about a high level gimbal manager. This message should be broadcast at a low regular rate (e.g. 5Hz)."]
13807#[doc = ""]
13808#[doc = "ID: 281"]
13809#[derive(Debug, Clone, PartialEq)]
13810#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13811#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13812#[cfg_attr(feature = "ts", derive(TS))]
13813#[cfg_attr(feature = "ts", ts(export))]
13814pub struct GIMBAL_MANAGER_STATUS_DATA {
13815 #[doc = "Timestamp (time since system boot)."]
13816 pub time_boot_ms: u32,
13817 #[doc = "High level gimbal manager flags currently applied."]
13818 pub flags: GimbalManagerFlags,
13819 #[doc = "Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal)."]
13820 pub gimbal_device_id: u8,
13821 #[doc = "System ID of MAVLink component with primary control, 0 for none."]
13822 pub primary_control_sysid: u8,
13823 #[doc = "Component ID of MAVLink component with primary control, 0 for none."]
13824 pub primary_control_compid: u8,
13825 #[doc = "System ID of MAVLink component with secondary control, 0 for none."]
13826 pub secondary_control_sysid: u8,
13827 #[doc = "Component ID of MAVLink component with secondary control, 0 for none."]
13828 pub secondary_control_compid: u8,
13829}
13830impl GIMBAL_MANAGER_STATUS_DATA {
13831 pub const ENCODED_LEN: usize = 13usize;
13832 pub const DEFAULT: Self = Self {
13833 time_boot_ms: 0_u32,
13834 flags: GimbalManagerFlags::DEFAULT,
13835 gimbal_device_id: 0_u8,
13836 primary_control_sysid: 0_u8,
13837 primary_control_compid: 0_u8,
13838 secondary_control_sysid: 0_u8,
13839 secondary_control_compid: 0_u8,
13840 };
13841 #[cfg(feature = "arbitrary")]
13842 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13843 use arbitrary::{Arbitrary, Unstructured};
13844 let mut buf = [0u8; 1024];
13845 rng.fill_bytes(&mut buf);
13846 let mut unstructured = Unstructured::new(&buf);
13847 Self::arbitrary(&mut unstructured).unwrap_or_default()
13848 }
13849}
13850impl Default for GIMBAL_MANAGER_STATUS_DATA {
13851 fn default() -> Self {
13852 Self::DEFAULT.clone()
13853 }
13854}
13855impl MessageData for GIMBAL_MANAGER_STATUS_DATA {
13856 type Message = MavMessage;
13857 const ID: u32 = 281u32;
13858 const NAME: &'static str = "GIMBAL_MANAGER_STATUS";
13859 const EXTRA_CRC: u8 = 48u8;
13860 const ENCODED_LEN: usize = 13usize;
13861 fn deser(
13862 _version: MavlinkVersion,
13863 __input: &[u8],
13864 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13865 let avail_len = __input.len();
13866 let mut payload_buf = [0; Self::ENCODED_LEN];
13867 let mut buf = if avail_len < Self::ENCODED_LEN {
13868 payload_buf[0..avail_len].copy_from_slice(__input);
13869 Bytes::new(&payload_buf)
13870 } else {
13871 Bytes::new(__input)
13872 };
13873 let mut __struct = Self::default();
13874 __struct.time_boot_ms = buf.get_u32_le();
13875 let tmp = buf.get_u32_le();
13876 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
13877 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13878 flag_type: "GimbalManagerFlags",
13879 value: tmp as u32,
13880 })?;
13881 __struct.gimbal_device_id = buf.get_u8();
13882 __struct.primary_control_sysid = buf.get_u8();
13883 __struct.primary_control_compid = buf.get_u8();
13884 __struct.secondary_control_sysid = buf.get_u8();
13885 __struct.secondary_control_compid = buf.get_u8();
13886 Ok(__struct)
13887 }
13888 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13889 let mut __tmp = BytesMut::new(bytes);
13890 #[allow(clippy::absurd_extreme_comparisons)]
13891 #[allow(unused_comparisons)]
13892 if __tmp.remaining() < Self::ENCODED_LEN {
13893 panic!(
13894 "buffer is too small (need {} bytes, but got {})",
13895 Self::ENCODED_LEN,
13896 __tmp.remaining(),
13897 )
13898 }
13899 __tmp.put_u32_le(self.time_boot_ms);
13900 __tmp.put_u32_le(self.flags.bits());
13901 __tmp.put_u8(self.gimbal_device_id);
13902 __tmp.put_u8(self.primary_control_sysid);
13903 __tmp.put_u8(self.primary_control_compid);
13904 __tmp.put_u8(self.secondary_control_sysid);
13905 __tmp.put_u8(self.secondary_control_compid);
13906 if matches!(version, MavlinkVersion::V2) {
13907 let len = __tmp.len();
13908 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13909 } else {
13910 __tmp.len()
13911 }
13912 }
13913}
13914#[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient."]
13915#[doc = ""]
13916#[doc = "ID: 33"]
13917#[derive(Debug, Clone, PartialEq)]
13918#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13919#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13920#[cfg_attr(feature = "ts", derive(TS))]
13921#[cfg_attr(feature = "ts", ts(export))]
13922pub struct GLOBAL_POSITION_INT_DATA {
13923 #[doc = "Timestamp (time since system boot)."]
13924 pub time_boot_ms: u32,
13925 #[doc = "Latitude, expressed"]
13926 pub lat: i32,
13927 #[doc = "Longitude, expressed"]
13928 pub lon: i32,
13929 #[doc = "Altitude (MSL). Note that virtually all GPS modules provide both WGS84 and MSL."]
13930 pub alt: i32,
13931 #[doc = "Altitude above home"]
13932 pub relative_alt: i32,
13933 #[doc = "Ground X Speed (Latitude, positive north)"]
13934 pub vx: i16,
13935 #[doc = "Ground Y Speed (Longitude, positive east)"]
13936 pub vy: i16,
13937 #[doc = "Ground Z Speed (Altitude, positive down)"]
13938 pub vz: i16,
13939 #[doc = "Vehicle heading (yaw angle), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
13940 pub hdg: u16,
13941}
13942impl GLOBAL_POSITION_INT_DATA {
13943 pub const ENCODED_LEN: usize = 28usize;
13944 pub const DEFAULT: Self = Self {
13945 time_boot_ms: 0_u32,
13946 lat: 0_i32,
13947 lon: 0_i32,
13948 alt: 0_i32,
13949 relative_alt: 0_i32,
13950 vx: 0_i16,
13951 vy: 0_i16,
13952 vz: 0_i16,
13953 hdg: 0_u16,
13954 };
13955 #[cfg(feature = "arbitrary")]
13956 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13957 use arbitrary::{Arbitrary, Unstructured};
13958 let mut buf = [0u8; 1024];
13959 rng.fill_bytes(&mut buf);
13960 let mut unstructured = Unstructured::new(&buf);
13961 Self::arbitrary(&mut unstructured).unwrap_or_default()
13962 }
13963}
13964impl Default for GLOBAL_POSITION_INT_DATA {
13965 fn default() -> Self {
13966 Self::DEFAULT.clone()
13967 }
13968}
13969impl MessageData for GLOBAL_POSITION_INT_DATA {
13970 type Message = MavMessage;
13971 const ID: u32 = 33u32;
13972 const NAME: &'static str = "GLOBAL_POSITION_INT";
13973 const EXTRA_CRC: u8 = 104u8;
13974 const ENCODED_LEN: usize = 28usize;
13975 fn deser(
13976 _version: MavlinkVersion,
13977 __input: &[u8],
13978 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13979 let avail_len = __input.len();
13980 let mut payload_buf = [0; Self::ENCODED_LEN];
13981 let mut buf = if avail_len < Self::ENCODED_LEN {
13982 payload_buf[0..avail_len].copy_from_slice(__input);
13983 Bytes::new(&payload_buf)
13984 } else {
13985 Bytes::new(__input)
13986 };
13987 let mut __struct = Self::default();
13988 __struct.time_boot_ms = buf.get_u32_le();
13989 __struct.lat = buf.get_i32_le();
13990 __struct.lon = buf.get_i32_le();
13991 __struct.alt = buf.get_i32_le();
13992 __struct.relative_alt = buf.get_i32_le();
13993 __struct.vx = buf.get_i16_le();
13994 __struct.vy = buf.get_i16_le();
13995 __struct.vz = buf.get_i16_le();
13996 __struct.hdg = buf.get_u16_le();
13997 Ok(__struct)
13998 }
13999 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14000 let mut __tmp = BytesMut::new(bytes);
14001 #[allow(clippy::absurd_extreme_comparisons)]
14002 #[allow(unused_comparisons)]
14003 if __tmp.remaining() < Self::ENCODED_LEN {
14004 panic!(
14005 "buffer is too small (need {} bytes, but got {})",
14006 Self::ENCODED_LEN,
14007 __tmp.remaining(),
14008 )
14009 }
14010 __tmp.put_u32_le(self.time_boot_ms);
14011 __tmp.put_i32_le(self.lat);
14012 __tmp.put_i32_le(self.lon);
14013 __tmp.put_i32_le(self.alt);
14014 __tmp.put_i32_le(self.relative_alt);
14015 __tmp.put_i16_le(self.vx);
14016 __tmp.put_i16_le(self.vy);
14017 __tmp.put_i16_le(self.vz);
14018 __tmp.put_u16_le(self.hdg);
14019 if matches!(version, MavlinkVersion::V2) {
14020 let len = __tmp.len();
14021 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14022 } else {
14023 __tmp.len()
14024 }
14025 }
14026}
14027#[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient. NOTE: This message is intended for onboard networks / companion computers and higher-bandwidth links and optimized for accuracy and completeness. Please use the GLOBAL_POSITION_INT message for a minimal subset."]
14028#[doc = ""]
14029#[doc = "ID: 63"]
14030#[derive(Debug, Clone, PartialEq)]
14031#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14032#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14033#[cfg_attr(feature = "ts", derive(TS))]
14034#[cfg_attr(feature = "ts", ts(export))]
14035pub struct GLOBAL_POSITION_INT_COV_DATA {
14036 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14037 pub time_usec: u64,
14038 #[doc = "Latitude"]
14039 pub lat: i32,
14040 #[doc = "Longitude"]
14041 pub lon: i32,
14042 #[doc = "Altitude in meters above MSL"]
14043 pub alt: i32,
14044 #[doc = "Altitude above ground"]
14045 pub relative_alt: i32,
14046 #[doc = "Ground X Speed (Latitude)"]
14047 pub vx: f32,
14048 #[doc = "Ground Y Speed (Longitude)"]
14049 pub vy: f32,
14050 #[doc = "Ground Z Speed (Altitude)"]
14051 pub vz: f32,
14052 #[doc = "Row-major representation of a 6x6 position and velocity 6x6 cross-covariance matrix (states: lat, lon, alt, vx, vy, vz; first six entries are the first ROW, next six entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
14053 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14054 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14055 pub covariance: [f32; 36],
14056 #[doc = "Class id of the estimator this estimate originated from."]
14057 pub estimator_type: MavEstimatorType,
14058}
14059impl GLOBAL_POSITION_INT_COV_DATA {
14060 pub const ENCODED_LEN: usize = 181usize;
14061 pub const DEFAULT: Self = Self {
14062 time_usec: 0_u64,
14063 lat: 0_i32,
14064 lon: 0_i32,
14065 alt: 0_i32,
14066 relative_alt: 0_i32,
14067 vx: 0.0_f32,
14068 vy: 0.0_f32,
14069 vz: 0.0_f32,
14070 covariance: [0.0_f32; 36usize],
14071 estimator_type: MavEstimatorType::DEFAULT,
14072 };
14073 #[cfg(feature = "arbitrary")]
14074 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14075 use arbitrary::{Arbitrary, Unstructured};
14076 let mut buf = [0u8; 1024];
14077 rng.fill_bytes(&mut buf);
14078 let mut unstructured = Unstructured::new(&buf);
14079 Self::arbitrary(&mut unstructured).unwrap_or_default()
14080 }
14081}
14082impl Default for GLOBAL_POSITION_INT_COV_DATA {
14083 fn default() -> Self {
14084 Self::DEFAULT.clone()
14085 }
14086}
14087impl MessageData for GLOBAL_POSITION_INT_COV_DATA {
14088 type Message = MavMessage;
14089 const ID: u32 = 63u32;
14090 const NAME: &'static str = "GLOBAL_POSITION_INT_COV";
14091 const EXTRA_CRC: u8 = 119u8;
14092 const ENCODED_LEN: usize = 181usize;
14093 fn deser(
14094 _version: MavlinkVersion,
14095 __input: &[u8],
14096 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14097 let avail_len = __input.len();
14098 let mut payload_buf = [0; Self::ENCODED_LEN];
14099 let mut buf = if avail_len < Self::ENCODED_LEN {
14100 payload_buf[0..avail_len].copy_from_slice(__input);
14101 Bytes::new(&payload_buf)
14102 } else {
14103 Bytes::new(__input)
14104 };
14105 let mut __struct = Self::default();
14106 __struct.time_usec = buf.get_u64_le();
14107 __struct.lat = buf.get_i32_le();
14108 __struct.lon = buf.get_i32_le();
14109 __struct.alt = buf.get_i32_le();
14110 __struct.relative_alt = buf.get_i32_le();
14111 __struct.vx = buf.get_f32_le();
14112 __struct.vy = buf.get_f32_le();
14113 __struct.vz = buf.get_f32_le();
14114 for v in &mut __struct.covariance {
14115 let val = buf.get_f32_le();
14116 *v = val;
14117 }
14118 let tmp = buf.get_u8();
14119 __struct.estimator_type =
14120 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14121 enum_type: "MavEstimatorType",
14122 value: tmp as u32,
14123 })?;
14124 Ok(__struct)
14125 }
14126 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14127 let mut __tmp = BytesMut::new(bytes);
14128 #[allow(clippy::absurd_extreme_comparisons)]
14129 #[allow(unused_comparisons)]
14130 if __tmp.remaining() < Self::ENCODED_LEN {
14131 panic!(
14132 "buffer is too small (need {} bytes, but got {})",
14133 Self::ENCODED_LEN,
14134 __tmp.remaining(),
14135 )
14136 }
14137 __tmp.put_u64_le(self.time_usec);
14138 __tmp.put_i32_le(self.lat);
14139 __tmp.put_i32_le(self.lon);
14140 __tmp.put_i32_le(self.alt);
14141 __tmp.put_i32_le(self.relative_alt);
14142 __tmp.put_f32_le(self.vx);
14143 __tmp.put_f32_le(self.vy);
14144 __tmp.put_f32_le(self.vz);
14145 for val in &self.covariance {
14146 __tmp.put_f32_le(*val);
14147 }
14148 __tmp.put_u8(self.estimator_type as u8);
14149 if matches!(version, MavlinkVersion::V2) {
14150 let len = __tmp.len();
14151 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14152 } else {
14153 __tmp.len()
14154 }
14155 }
14156}
14157#[doc = "Global position/attitude estimate from a vision source."]
14158#[doc = ""]
14159#[doc = "ID: 101"]
14160#[derive(Debug, Clone, PartialEq)]
14161#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14162#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14163#[cfg_attr(feature = "ts", derive(TS))]
14164#[cfg_attr(feature = "ts", ts(export))]
14165pub struct GLOBAL_VISION_POSITION_ESTIMATE_DATA {
14166 #[doc = "Timestamp (UNIX time or since system boot)"]
14167 pub usec: u64,
14168 #[doc = "Global X position"]
14169 pub x: f32,
14170 #[doc = "Global Y position"]
14171 pub y: f32,
14172 #[doc = "Global Z position"]
14173 pub z: f32,
14174 #[doc = "Roll angle"]
14175 pub roll: f32,
14176 #[doc = "Pitch angle"]
14177 pub pitch: f32,
14178 #[doc = "Yaw angle"]
14179 pub yaw: f32,
14180 #[doc = "Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x_global, y_global, z_global, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
14181 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14182 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14183 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14184 pub covariance: [f32; 21],
14185 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
14186 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14187 pub reset_counter: u8,
14188}
14189impl GLOBAL_VISION_POSITION_ESTIMATE_DATA {
14190 pub const ENCODED_LEN: usize = 117usize;
14191 pub const DEFAULT: Self = Self {
14192 usec: 0_u64,
14193 x: 0.0_f32,
14194 y: 0.0_f32,
14195 z: 0.0_f32,
14196 roll: 0.0_f32,
14197 pitch: 0.0_f32,
14198 yaw: 0.0_f32,
14199 covariance: [0.0_f32; 21usize],
14200 reset_counter: 0_u8,
14201 };
14202 #[cfg(feature = "arbitrary")]
14203 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14204 use arbitrary::{Arbitrary, Unstructured};
14205 let mut buf = [0u8; 1024];
14206 rng.fill_bytes(&mut buf);
14207 let mut unstructured = Unstructured::new(&buf);
14208 Self::arbitrary(&mut unstructured).unwrap_or_default()
14209 }
14210}
14211impl Default for GLOBAL_VISION_POSITION_ESTIMATE_DATA {
14212 fn default() -> Self {
14213 Self::DEFAULT.clone()
14214 }
14215}
14216impl MessageData for GLOBAL_VISION_POSITION_ESTIMATE_DATA {
14217 type Message = MavMessage;
14218 const ID: u32 = 101u32;
14219 const NAME: &'static str = "GLOBAL_VISION_POSITION_ESTIMATE";
14220 const EXTRA_CRC: u8 = 102u8;
14221 const ENCODED_LEN: usize = 117usize;
14222 fn deser(
14223 _version: MavlinkVersion,
14224 __input: &[u8],
14225 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14226 let avail_len = __input.len();
14227 let mut payload_buf = [0; Self::ENCODED_LEN];
14228 let mut buf = if avail_len < Self::ENCODED_LEN {
14229 payload_buf[0..avail_len].copy_from_slice(__input);
14230 Bytes::new(&payload_buf)
14231 } else {
14232 Bytes::new(__input)
14233 };
14234 let mut __struct = Self::default();
14235 __struct.usec = buf.get_u64_le();
14236 __struct.x = buf.get_f32_le();
14237 __struct.y = buf.get_f32_le();
14238 __struct.z = buf.get_f32_le();
14239 __struct.roll = buf.get_f32_le();
14240 __struct.pitch = buf.get_f32_le();
14241 __struct.yaw = buf.get_f32_le();
14242 for v in &mut __struct.covariance {
14243 let val = buf.get_f32_le();
14244 *v = val;
14245 }
14246 __struct.reset_counter = buf.get_u8();
14247 Ok(__struct)
14248 }
14249 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14250 let mut __tmp = BytesMut::new(bytes);
14251 #[allow(clippy::absurd_extreme_comparisons)]
14252 #[allow(unused_comparisons)]
14253 if __tmp.remaining() < Self::ENCODED_LEN {
14254 panic!(
14255 "buffer is too small (need {} bytes, but got {})",
14256 Self::ENCODED_LEN,
14257 __tmp.remaining(),
14258 )
14259 }
14260 __tmp.put_u64_le(self.usec);
14261 __tmp.put_f32_le(self.x);
14262 __tmp.put_f32_le(self.y);
14263 __tmp.put_f32_le(self.z);
14264 __tmp.put_f32_le(self.roll);
14265 __tmp.put_f32_le(self.pitch);
14266 __tmp.put_f32_le(self.yaw);
14267 if matches!(version, MavlinkVersion::V2) {
14268 for val in &self.covariance {
14269 __tmp.put_f32_le(*val);
14270 }
14271 __tmp.put_u8(self.reset_counter);
14272 let len = __tmp.len();
14273 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14274 } else {
14275 __tmp.len()
14276 }
14277 }
14278}
14279#[doc = "Second GPS data."]
14280#[doc = ""]
14281#[doc = "ID: 124"]
14282#[derive(Debug, Clone, PartialEq)]
14283#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14284#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14285#[cfg_attr(feature = "ts", derive(TS))]
14286#[cfg_attr(feature = "ts", ts(export))]
14287pub struct GPS2_RAW_DATA {
14288 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14289 pub time_usec: u64,
14290 #[doc = "Latitude (WGS84)"]
14291 pub lat: i32,
14292 #[doc = "Longitude (WGS84)"]
14293 pub lon: i32,
14294 #[doc = "Altitude (MSL). Positive for up."]
14295 pub alt: i32,
14296 #[doc = "Age of DGPS info"]
14297 pub dgps_age: u32,
14298 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
14299 pub eph: u16,
14300 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
14301 pub epv: u16,
14302 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
14303 pub vel: u16,
14304 #[doc = "Course over ground (NOT heading, but direction of movement): 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
14305 pub cog: u16,
14306 #[doc = "GPS fix type."]
14307 pub fix_type: GpsFixType,
14308 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
14309 pub satellites_visible: u8,
14310 #[doc = "Number of DGPS satellites"]
14311 pub dgps_numch: u8,
14312 #[doc = "Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use UINT16_MAX if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north."]
14313 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14314 pub yaw: u16,
14315 #[doc = "Altitude (above WGS84, EGM96 ellipsoid). Positive for up."]
14316 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14317 pub alt_ellipsoid: i32,
14318 #[doc = "Position uncertainty."]
14319 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14320 pub h_acc: u32,
14321 #[doc = "Altitude uncertainty."]
14322 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14323 pub v_acc: u32,
14324 #[doc = "Speed uncertainty."]
14325 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14326 pub vel_acc: u32,
14327 #[doc = "Heading / track uncertainty"]
14328 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14329 pub hdg_acc: u32,
14330}
14331impl GPS2_RAW_DATA {
14332 pub const ENCODED_LEN: usize = 57usize;
14333 pub const DEFAULT: Self = Self {
14334 time_usec: 0_u64,
14335 lat: 0_i32,
14336 lon: 0_i32,
14337 alt: 0_i32,
14338 dgps_age: 0_u32,
14339 eph: 0_u16,
14340 epv: 0_u16,
14341 vel: 0_u16,
14342 cog: 0_u16,
14343 fix_type: GpsFixType::DEFAULT,
14344 satellites_visible: 0_u8,
14345 dgps_numch: 0_u8,
14346 yaw: 0_u16,
14347 alt_ellipsoid: 0_i32,
14348 h_acc: 0_u32,
14349 v_acc: 0_u32,
14350 vel_acc: 0_u32,
14351 hdg_acc: 0_u32,
14352 };
14353 #[cfg(feature = "arbitrary")]
14354 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14355 use arbitrary::{Arbitrary, Unstructured};
14356 let mut buf = [0u8; 1024];
14357 rng.fill_bytes(&mut buf);
14358 let mut unstructured = Unstructured::new(&buf);
14359 Self::arbitrary(&mut unstructured).unwrap_or_default()
14360 }
14361}
14362impl Default for GPS2_RAW_DATA {
14363 fn default() -> Self {
14364 Self::DEFAULT.clone()
14365 }
14366}
14367impl MessageData for GPS2_RAW_DATA {
14368 type Message = MavMessage;
14369 const ID: u32 = 124u32;
14370 const NAME: &'static str = "GPS2_RAW";
14371 const EXTRA_CRC: u8 = 87u8;
14372 const ENCODED_LEN: usize = 57usize;
14373 fn deser(
14374 _version: MavlinkVersion,
14375 __input: &[u8],
14376 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14377 let avail_len = __input.len();
14378 let mut payload_buf = [0; Self::ENCODED_LEN];
14379 let mut buf = if avail_len < Self::ENCODED_LEN {
14380 payload_buf[0..avail_len].copy_from_slice(__input);
14381 Bytes::new(&payload_buf)
14382 } else {
14383 Bytes::new(__input)
14384 };
14385 let mut __struct = Self::default();
14386 __struct.time_usec = buf.get_u64_le();
14387 __struct.lat = buf.get_i32_le();
14388 __struct.lon = buf.get_i32_le();
14389 __struct.alt = buf.get_i32_le();
14390 __struct.dgps_age = buf.get_u32_le();
14391 __struct.eph = buf.get_u16_le();
14392 __struct.epv = buf.get_u16_le();
14393 __struct.vel = buf.get_u16_le();
14394 __struct.cog = buf.get_u16_le();
14395 let tmp = buf.get_u8();
14396 __struct.fix_type =
14397 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14398 enum_type: "GpsFixType",
14399 value: tmp as u32,
14400 })?;
14401 __struct.satellites_visible = buf.get_u8();
14402 __struct.dgps_numch = buf.get_u8();
14403 __struct.yaw = buf.get_u16_le();
14404 __struct.alt_ellipsoid = buf.get_i32_le();
14405 __struct.h_acc = buf.get_u32_le();
14406 __struct.v_acc = buf.get_u32_le();
14407 __struct.vel_acc = buf.get_u32_le();
14408 __struct.hdg_acc = buf.get_u32_le();
14409 Ok(__struct)
14410 }
14411 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14412 let mut __tmp = BytesMut::new(bytes);
14413 #[allow(clippy::absurd_extreme_comparisons)]
14414 #[allow(unused_comparisons)]
14415 if __tmp.remaining() < Self::ENCODED_LEN {
14416 panic!(
14417 "buffer is too small (need {} bytes, but got {})",
14418 Self::ENCODED_LEN,
14419 __tmp.remaining(),
14420 )
14421 }
14422 __tmp.put_u64_le(self.time_usec);
14423 __tmp.put_i32_le(self.lat);
14424 __tmp.put_i32_le(self.lon);
14425 __tmp.put_i32_le(self.alt);
14426 __tmp.put_u32_le(self.dgps_age);
14427 __tmp.put_u16_le(self.eph);
14428 __tmp.put_u16_le(self.epv);
14429 __tmp.put_u16_le(self.vel);
14430 __tmp.put_u16_le(self.cog);
14431 __tmp.put_u8(self.fix_type as u8);
14432 __tmp.put_u8(self.satellites_visible);
14433 __tmp.put_u8(self.dgps_numch);
14434 if matches!(version, MavlinkVersion::V2) {
14435 __tmp.put_u16_le(self.yaw);
14436 __tmp.put_i32_le(self.alt_ellipsoid);
14437 __tmp.put_u32_le(self.h_acc);
14438 __tmp.put_u32_le(self.v_acc);
14439 __tmp.put_u32_le(self.vel_acc);
14440 __tmp.put_u32_le(self.hdg_acc);
14441 let len = __tmp.len();
14442 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14443 } else {
14444 __tmp.len()
14445 }
14446 }
14447}
14448#[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
14449#[doc = ""]
14450#[doc = "ID: 128"]
14451#[derive(Debug, Clone, PartialEq)]
14452#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14453#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14454#[cfg_attr(feature = "ts", derive(TS))]
14455#[cfg_attr(feature = "ts", ts(export))]
14456pub struct GPS2_RTK_DATA {
14457 #[doc = "Time since boot of last baseline message received."]
14458 pub time_last_baseline_ms: u32,
14459 #[doc = "GPS Time of Week of last baseline"]
14460 pub tow: u32,
14461 #[doc = "Current baseline in ECEF x or NED north component."]
14462 pub baseline_a_mm: i32,
14463 #[doc = "Current baseline in ECEF y or NED east component."]
14464 pub baseline_b_mm: i32,
14465 #[doc = "Current baseline in ECEF z or NED down component."]
14466 pub baseline_c_mm: i32,
14467 #[doc = "Current estimate of baseline accuracy."]
14468 pub accuracy: u32,
14469 #[doc = "Current number of integer ambiguity hypotheses."]
14470 pub iar_num_hypotheses: i32,
14471 #[doc = "GPS Week Number of last baseline"]
14472 pub wn: u16,
14473 #[doc = "Identification of connected RTK receiver."]
14474 pub rtk_receiver_id: u8,
14475 #[doc = "GPS-specific health report for RTK data."]
14476 pub rtk_health: u8,
14477 #[doc = "Rate of baseline messages being received by GPS"]
14478 pub rtk_rate: u8,
14479 #[doc = "Current number of sats used for RTK calculation."]
14480 pub nsats: u8,
14481 #[doc = "Coordinate system of baseline"]
14482 pub baseline_coords_type: RtkBaselineCoordinateSystem,
14483}
14484impl GPS2_RTK_DATA {
14485 pub const ENCODED_LEN: usize = 35usize;
14486 pub const DEFAULT: Self = Self {
14487 time_last_baseline_ms: 0_u32,
14488 tow: 0_u32,
14489 baseline_a_mm: 0_i32,
14490 baseline_b_mm: 0_i32,
14491 baseline_c_mm: 0_i32,
14492 accuracy: 0_u32,
14493 iar_num_hypotheses: 0_i32,
14494 wn: 0_u16,
14495 rtk_receiver_id: 0_u8,
14496 rtk_health: 0_u8,
14497 rtk_rate: 0_u8,
14498 nsats: 0_u8,
14499 baseline_coords_type: RtkBaselineCoordinateSystem::DEFAULT,
14500 };
14501 #[cfg(feature = "arbitrary")]
14502 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14503 use arbitrary::{Arbitrary, Unstructured};
14504 let mut buf = [0u8; 1024];
14505 rng.fill_bytes(&mut buf);
14506 let mut unstructured = Unstructured::new(&buf);
14507 Self::arbitrary(&mut unstructured).unwrap_or_default()
14508 }
14509}
14510impl Default for GPS2_RTK_DATA {
14511 fn default() -> Self {
14512 Self::DEFAULT.clone()
14513 }
14514}
14515impl MessageData for GPS2_RTK_DATA {
14516 type Message = MavMessage;
14517 const ID: u32 = 128u32;
14518 const NAME: &'static str = "GPS2_RTK";
14519 const EXTRA_CRC: u8 = 226u8;
14520 const ENCODED_LEN: usize = 35usize;
14521 fn deser(
14522 _version: MavlinkVersion,
14523 __input: &[u8],
14524 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14525 let avail_len = __input.len();
14526 let mut payload_buf = [0; Self::ENCODED_LEN];
14527 let mut buf = if avail_len < Self::ENCODED_LEN {
14528 payload_buf[0..avail_len].copy_from_slice(__input);
14529 Bytes::new(&payload_buf)
14530 } else {
14531 Bytes::new(__input)
14532 };
14533 let mut __struct = Self::default();
14534 __struct.time_last_baseline_ms = buf.get_u32_le();
14535 __struct.tow = buf.get_u32_le();
14536 __struct.baseline_a_mm = buf.get_i32_le();
14537 __struct.baseline_b_mm = buf.get_i32_le();
14538 __struct.baseline_c_mm = buf.get_i32_le();
14539 __struct.accuracy = buf.get_u32_le();
14540 __struct.iar_num_hypotheses = buf.get_i32_le();
14541 __struct.wn = buf.get_u16_le();
14542 __struct.rtk_receiver_id = buf.get_u8();
14543 __struct.rtk_health = buf.get_u8();
14544 __struct.rtk_rate = buf.get_u8();
14545 __struct.nsats = buf.get_u8();
14546 let tmp = buf.get_u8();
14547 __struct.baseline_coords_type =
14548 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14549 enum_type: "RtkBaselineCoordinateSystem",
14550 value: tmp as u32,
14551 })?;
14552 Ok(__struct)
14553 }
14554 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14555 let mut __tmp = BytesMut::new(bytes);
14556 #[allow(clippy::absurd_extreme_comparisons)]
14557 #[allow(unused_comparisons)]
14558 if __tmp.remaining() < Self::ENCODED_LEN {
14559 panic!(
14560 "buffer is too small (need {} bytes, but got {})",
14561 Self::ENCODED_LEN,
14562 __tmp.remaining(),
14563 )
14564 }
14565 __tmp.put_u32_le(self.time_last_baseline_ms);
14566 __tmp.put_u32_le(self.tow);
14567 __tmp.put_i32_le(self.baseline_a_mm);
14568 __tmp.put_i32_le(self.baseline_b_mm);
14569 __tmp.put_i32_le(self.baseline_c_mm);
14570 __tmp.put_u32_le(self.accuracy);
14571 __tmp.put_i32_le(self.iar_num_hypotheses);
14572 __tmp.put_u16_le(self.wn);
14573 __tmp.put_u8(self.rtk_receiver_id);
14574 __tmp.put_u8(self.rtk_health);
14575 __tmp.put_u8(self.rtk_rate);
14576 __tmp.put_u8(self.nsats);
14577 __tmp.put_u8(self.baseline_coords_type as u8);
14578 if matches!(version, MavlinkVersion::V2) {
14579 let len = __tmp.len();
14580 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14581 } else {
14582 __tmp.len()
14583 }
14584 }
14585}
14586#[doc = "Publishes the GPS coordinates of the vehicle local origin (0,0,0) position. Emitted whenever a new GPS-Local position mapping is requested or set - e.g. following SET_GPS_GLOBAL_ORIGIN message."]
14587#[doc = ""]
14588#[doc = "ID: 49"]
14589#[derive(Debug, Clone, PartialEq)]
14590#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14591#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14592#[cfg_attr(feature = "ts", derive(TS))]
14593#[cfg_attr(feature = "ts", ts(export))]
14594pub struct GPS_GLOBAL_ORIGIN_DATA {
14595 #[doc = "Latitude (WGS84)"]
14596 pub latitude: i32,
14597 #[doc = "Longitude (WGS84)"]
14598 pub longitude: i32,
14599 #[doc = "Altitude (MSL). Positive for up."]
14600 pub altitude: i32,
14601 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14602 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14603 pub time_usec: u64,
14604}
14605impl GPS_GLOBAL_ORIGIN_DATA {
14606 pub const ENCODED_LEN: usize = 20usize;
14607 pub const DEFAULT: Self = Self {
14608 latitude: 0_i32,
14609 longitude: 0_i32,
14610 altitude: 0_i32,
14611 time_usec: 0_u64,
14612 };
14613 #[cfg(feature = "arbitrary")]
14614 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14615 use arbitrary::{Arbitrary, Unstructured};
14616 let mut buf = [0u8; 1024];
14617 rng.fill_bytes(&mut buf);
14618 let mut unstructured = Unstructured::new(&buf);
14619 Self::arbitrary(&mut unstructured).unwrap_or_default()
14620 }
14621}
14622impl Default for GPS_GLOBAL_ORIGIN_DATA {
14623 fn default() -> Self {
14624 Self::DEFAULT.clone()
14625 }
14626}
14627impl MessageData for GPS_GLOBAL_ORIGIN_DATA {
14628 type Message = MavMessage;
14629 const ID: u32 = 49u32;
14630 const NAME: &'static str = "GPS_GLOBAL_ORIGIN";
14631 const EXTRA_CRC: u8 = 39u8;
14632 const ENCODED_LEN: usize = 20usize;
14633 fn deser(
14634 _version: MavlinkVersion,
14635 __input: &[u8],
14636 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14637 let avail_len = __input.len();
14638 let mut payload_buf = [0; Self::ENCODED_LEN];
14639 let mut buf = if avail_len < Self::ENCODED_LEN {
14640 payload_buf[0..avail_len].copy_from_slice(__input);
14641 Bytes::new(&payload_buf)
14642 } else {
14643 Bytes::new(__input)
14644 };
14645 let mut __struct = Self::default();
14646 __struct.latitude = buf.get_i32_le();
14647 __struct.longitude = buf.get_i32_le();
14648 __struct.altitude = buf.get_i32_le();
14649 __struct.time_usec = buf.get_u64_le();
14650 Ok(__struct)
14651 }
14652 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14653 let mut __tmp = BytesMut::new(bytes);
14654 #[allow(clippy::absurd_extreme_comparisons)]
14655 #[allow(unused_comparisons)]
14656 if __tmp.remaining() < Self::ENCODED_LEN {
14657 panic!(
14658 "buffer is too small (need {} bytes, but got {})",
14659 Self::ENCODED_LEN,
14660 __tmp.remaining(),
14661 )
14662 }
14663 __tmp.put_i32_le(self.latitude);
14664 __tmp.put_i32_le(self.longitude);
14665 __tmp.put_i32_le(self.altitude);
14666 if matches!(version, MavlinkVersion::V2) {
14667 __tmp.put_u64_le(self.time_usec);
14668 let len = __tmp.len();
14669 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14670 } else {
14671 __tmp.len()
14672 }
14673 }
14674}
14675#[deprecated = " See `GPS_RTCM_DATA` (Deprecated since 2022-05)"]
14676#[doc = "Data for injecting into the onboard GPS (used for DGPS)."]
14677#[doc = ""]
14678#[doc = "ID: 123"]
14679#[derive(Debug, Clone, PartialEq)]
14680#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14681#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14682#[cfg_attr(feature = "ts", derive(TS))]
14683#[cfg_attr(feature = "ts", ts(export))]
14684pub struct GPS_INJECT_DATA_DATA {
14685 #[doc = "System ID"]
14686 pub target_system: u8,
14687 #[doc = "Component ID"]
14688 pub target_component: u8,
14689 #[doc = "Data length"]
14690 pub len: u8,
14691 #[doc = "Raw data (110 is enough for 12 satellites of RTCMv2)"]
14692 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14693 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14694 pub data: [u8; 110],
14695}
14696impl GPS_INJECT_DATA_DATA {
14697 pub const ENCODED_LEN: usize = 113usize;
14698 pub const DEFAULT: Self = Self {
14699 target_system: 0_u8,
14700 target_component: 0_u8,
14701 len: 0_u8,
14702 data: [0_u8; 110usize],
14703 };
14704 #[cfg(feature = "arbitrary")]
14705 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14706 use arbitrary::{Arbitrary, Unstructured};
14707 let mut buf = [0u8; 1024];
14708 rng.fill_bytes(&mut buf);
14709 let mut unstructured = Unstructured::new(&buf);
14710 Self::arbitrary(&mut unstructured).unwrap_or_default()
14711 }
14712}
14713impl Default for GPS_INJECT_DATA_DATA {
14714 fn default() -> Self {
14715 Self::DEFAULT.clone()
14716 }
14717}
14718impl MessageData for GPS_INJECT_DATA_DATA {
14719 type Message = MavMessage;
14720 const ID: u32 = 123u32;
14721 const NAME: &'static str = "GPS_INJECT_DATA";
14722 const EXTRA_CRC: u8 = 250u8;
14723 const ENCODED_LEN: usize = 113usize;
14724 fn deser(
14725 _version: MavlinkVersion,
14726 __input: &[u8],
14727 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14728 let avail_len = __input.len();
14729 let mut payload_buf = [0; Self::ENCODED_LEN];
14730 let mut buf = if avail_len < Self::ENCODED_LEN {
14731 payload_buf[0..avail_len].copy_from_slice(__input);
14732 Bytes::new(&payload_buf)
14733 } else {
14734 Bytes::new(__input)
14735 };
14736 let mut __struct = Self::default();
14737 __struct.target_system = buf.get_u8();
14738 __struct.target_component = buf.get_u8();
14739 __struct.len = buf.get_u8();
14740 for v in &mut __struct.data {
14741 let val = buf.get_u8();
14742 *v = val;
14743 }
14744 Ok(__struct)
14745 }
14746 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14747 let mut __tmp = BytesMut::new(bytes);
14748 #[allow(clippy::absurd_extreme_comparisons)]
14749 #[allow(unused_comparisons)]
14750 if __tmp.remaining() < Self::ENCODED_LEN {
14751 panic!(
14752 "buffer is too small (need {} bytes, but got {})",
14753 Self::ENCODED_LEN,
14754 __tmp.remaining(),
14755 )
14756 }
14757 __tmp.put_u8(self.target_system);
14758 __tmp.put_u8(self.target_component);
14759 __tmp.put_u8(self.len);
14760 for val in &self.data {
14761 __tmp.put_u8(*val);
14762 }
14763 if matches!(version, MavlinkVersion::V2) {
14764 let len = __tmp.len();
14765 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14766 } else {
14767 __tmp.len()
14768 }
14769 }
14770}
14771#[doc = "GPS sensor input message. This is a raw sensor value sent by the GPS. This is NOT the global position estimate of the system."]
14772#[doc = ""]
14773#[doc = "ID: 232"]
14774#[derive(Debug, Clone, PartialEq)]
14775#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14776#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14777#[cfg_attr(feature = "ts", derive(TS))]
14778#[cfg_attr(feature = "ts", ts(export))]
14779pub struct GPS_INPUT_DATA {
14780 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14781 pub time_usec: u64,
14782 #[doc = "GPS time (from start of GPS week)"]
14783 pub time_week_ms: u32,
14784 #[doc = "Latitude (WGS84)"]
14785 pub lat: i32,
14786 #[doc = "Longitude (WGS84)"]
14787 pub lon: i32,
14788 #[doc = "Altitude (MSL). Positive for up."]
14789 pub alt: f32,
14790 #[doc = "GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX"]
14791 pub hdop: f32,
14792 #[doc = "GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX"]
14793 pub vdop: f32,
14794 #[doc = "GPS velocity in north direction in earth-fixed NED frame"]
14795 pub vn: f32,
14796 #[doc = "GPS velocity in east direction in earth-fixed NED frame"]
14797 pub ve: f32,
14798 #[doc = "GPS velocity in down direction in earth-fixed NED frame"]
14799 pub vd: f32,
14800 #[doc = "GPS speed accuracy"]
14801 pub speed_accuracy: f32,
14802 #[doc = "GPS horizontal accuracy"]
14803 pub horiz_accuracy: f32,
14804 #[doc = "GPS vertical accuracy"]
14805 pub vert_accuracy: f32,
14806 #[doc = "Bitmap indicating which GPS input flags fields to ignore. All other fields must be provided."]
14807 pub ignore_flags: GpsInputIgnoreFlags,
14808 #[doc = "GPS week number"]
14809 pub time_week: u16,
14810 #[doc = "ID of the GPS for multiple GPS inputs"]
14811 pub gps_id: u8,
14812 #[doc = "0-1: no fix, 2: 2D fix, 3: 3D fix. 4: 3D with DGPS. 5: 3D with RTK"]
14813 pub fix_type: u8,
14814 #[doc = "Number of satellites visible."]
14815 pub satellites_visible: u8,
14816 #[doc = "Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north"]
14817 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14818 pub yaw: u16,
14819}
14820impl GPS_INPUT_DATA {
14821 pub const ENCODED_LEN: usize = 65usize;
14822 pub const DEFAULT: Self = Self {
14823 time_usec: 0_u64,
14824 time_week_ms: 0_u32,
14825 lat: 0_i32,
14826 lon: 0_i32,
14827 alt: 0.0_f32,
14828 hdop: 0.0_f32,
14829 vdop: 0.0_f32,
14830 vn: 0.0_f32,
14831 ve: 0.0_f32,
14832 vd: 0.0_f32,
14833 speed_accuracy: 0.0_f32,
14834 horiz_accuracy: 0.0_f32,
14835 vert_accuracy: 0.0_f32,
14836 ignore_flags: GpsInputIgnoreFlags::DEFAULT,
14837 time_week: 0_u16,
14838 gps_id: 0_u8,
14839 fix_type: 0_u8,
14840 satellites_visible: 0_u8,
14841 yaw: 0_u16,
14842 };
14843 #[cfg(feature = "arbitrary")]
14844 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14845 use arbitrary::{Arbitrary, Unstructured};
14846 let mut buf = [0u8; 1024];
14847 rng.fill_bytes(&mut buf);
14848 let mut unstructured = Unstructured::new(&buf);
14849 Self::arbitrary(&mut unstructured).unwrap_or_default()
14850 }
14851}
14852impl Default for GPS_INPUT_DATA {
14853 fn default() -> Self {
14854 Self::DEFAULT.clone()
14855 }
14856}
14857impl MessageData for GPS_INPUT_DATA {
14858 type Message = MavMessage;
14859 const ID: u32 = 232u32;
14860 const NAME: &'static str = "GPS_INPUT";
14861 const EXTRA_CRC: u8 = 151u8;
14862 const ENCODED_LEN: usize = 65usize;
14863 fn deser(
14864 _version: MavlinkVersion,
14865 __input: &[u8],
14866 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14867 let avail_len = __input.len();
14868 let mut payload_buf = [0; Self::ENCODED_LEN];
14869 let mut buf = if avail_len < Self::ENCODED_LEN {
14870 payload_buf[0..avail_len].copy_from_slice(__input);
14871 Bytes::new(&payload_buf)
14872 } else {
14873 Bytes::new(__input)
14874 };
14875 let mut __struct = Self::default();
14876 __struct.time_usec = buf.get_u64_le();
14877 __struct.time_week_ms = buf.get_u32_le();
14878 __struct.lat = buf.get_i32_le();
14879 __struct.lon = buf.get_i32_le();
14880 __struct.alt = buf.get_f32_le();
14881 __struct.hdop = buf.get_f32_le();
14882 __struct.vdop = buf.get_f32_le();
14883 __struct.vn = buf.get_f32_le();
14884 __struct.ve = buf.get_f32_le();
14885 __struct.vd = buf.get_f32_le();
14886 __struct.speed_accuracy = buf.get_f32_le();
14887 __struct.horiz_accuracy = buf.get_f32_le();
14888 __struct.vert_accuracy = buf.get_f32_le();
14889 let tmp = buf.get_u16_le();
14890 __struct.ignore_flags = GpsInputIgnoreFlags::from_bits(
14891 tmp & GpsInputIgnoreFlags::all().bits(),
14892 )
14893 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
14894 flag_type: "GpsInputIgnoreFlags",
14895 value: tmp as u32,
14896 })?;
14897 __struct.time_week = buf.get_u16_le();
14898 __struct.gps_id = buf.get_u8();
14899 __struct.fix_type = buf.get_u8();
14900 __struct.satellites_visible = buf.get_u8();
14901 __struct.yaw = buf.get_u16_le();
14902 Ok(__struct)
14903 }
14904 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14905 let mut __tmp = BytesMut::new(bytes);
14906 #[allow(clippy::absurd_extreme_comparisons)]
14907 #[allow(unused_comparisons)]
14908 if __tmp.remaining() < Self::ENCODED_LEN {
14909 panic!(
14910 "buffer is too small (need {} bytes, but got {})",
14911 Self::ENCODED_LEN,
14912 __tmp.remaining(),
14913 )
14914 }
14915 __tmp.put_u64_le(self.time_usec);
14916 __tmp.put_u32_le(self.time_week_ms);
14917 __tmp.put_i32_le(self.lat);
14918 __tmp.put_i32_le(self.lon);
14919 __tmp.put_f32_le(self.alt);
14920 __tmp.put_f32_le(self.hdop);
14921 __tmp.put_f32_le(self.vdop);
14922 __tmp.put_f32_le(self.vn);
14923 __tmp.put_f32_le(self.ve);
14924 __tmp.put_f32_le(self.vd);
14925 __tmp.put_f32_le(self.speed_accuracy);
14926 __tmp.put_f32_le(self.horiz_accuracy);
14927 __tmp.put_f32_le(self.vert_accuracy);
14928 __tmp.put_u16_le(self.ignore_flags.bits());
14929 __tmp.put_u16_le(self.time_week);
14930 __tmp.put_u8(self.gps_id);
14931 __tmp.put_u8(self.fix_type);
14932 __tmp.put_u8(self.satellites_visible);
14933 if matches!(version, MavlinkVersion::V2) {
14934 __tmp.put_u16_le(self.yaw);
14935 let len = __tmp.len();
14936 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14937 } else {
14938 __tmp.len()
14939 }
14940 }
14941}
14942#[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
14943#[doc = ""]
14944#[doc = "ID: 24"]
14945#[derive(Debug, Clone, PartialEq)]
14946#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14947#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14948#[cfg_attr(feature = "ts", derive(TS))]
14949#[cfg_attr(feature = "ts", ts(export))]
14950pub struct GPS_RAW_INT_DATA {
14951 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14952 pub time_usec: u64,
14953 #[doc = "Latitude (WGS84, EGM96 ellipsoid)"]
14954 pub lat: i32,
14955 #[doc = "Longitude (WGS84, EGM96 ellipsoid)"]
14956 pub lon: i32,
14957 #[doc = "Altitude (MSL). Positive for up. Note that virtually all GPS modules provide the MSL altitude in addition to the WGS84 altitude."]
14958 pub alt: i32,
14959 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
14960 pub eph: u16,
14961 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
14962 pub epv: u16,
14963 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
14964 pub vel: u16,
14965 #[doc = "Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
14966 pub cog: u16,
14967 #[doc = "GPS fix type."]
14968 pub fix_type: GpsFixType,
14969 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
14970 pub satellites_visible: u8,
14971 #[doc = "Altitude (above WGS84, EGM96 ellipsoid). Positive for up."]
14972 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14973 pub alt_ellipsoid: i32,
14974 #[doc = "Position uncertainty."]
14975 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14976 pub h_acc: u32,
14977 #[doc = "Altitude uncertainty."]
14978 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14979 pub v_acc: u32,
14980 #[doc = "Speed uncertainty."]
14981 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14982 pub vel_acc: u32,
14983 #[doc = "Heading / track uncertainty"]
14984 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14985 pub hdg_acc: u32,
14986 #[doc = "Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use UINT16_MAX if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north."]
14987 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14988 pub yaw: u16,
14989}
14990impl GPS_RAW_INT_DATA {
14991 pub const ENCODED_LEN: usize = 52usize;
14992 pub const DEFAULT: Self = Self {
14993 time_usec: 0_u64,
14994 lat: 0_i32,
14995 lon: 0_i32,
14996 alt: 0_i32,
14997 eph: 0_u16,
14998 epv: 0_u16,
14999 vel: 0_u16,
15000 cog: 0_u16,
15001 fix_type: GpsFixType::DEFAULT,
15002 satellites_visible: 0_u8,
15003 alt_ellipsoid: 0_i32,
15004 h_acc: 0_u32,
15005 v_acc: 0_u32,
15006 vel_acc: 0_u32,
15007 hdg_acc: 0_u32,
15008 yaw: 0_u16,
15009 };
15010 #[cfg(feature = "arbitrary")]
15011 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15012 use arbitrary::{Arbitrary, Unstructured};
15013 let mut buf = [0u8; 1024];
15014 rng.fill_bytes(&mut buf);
15015 let mut unstructured = Unstructured::new(&buf);
15016 Self::arbitrary(&mut unstructured).unwrap_or_default()
15017 }
15018}
15019impl Default for GPS_RAW_INT_DATA {
15020 fn default() -> Self {
15021 Self::DEFAULT.clone()
15022 }
15023}
15024impl MessageData for GPS_RAW_INT_DATA {
15025 type Message = MavMessage;
15026 const ID: u32 = 24u32;
15027 const NAME: &'static str = "GPS_RAW_INT";
15028 const EXTRA_CRC: u8 = 24u8;
15029 const ENCODED_LEN: usize = 52usize;
15030 fn deser(
15031 _version: MavlinkVersion,
15032 __input: &[u8],
15033 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15034 let avail_len = __input.len();
15035 let mut payload_buf = [0; Self::ENCODED_LEN];
15036 let mut buf = if avail_len < Self::ENCODED_LEN {
15037 payload_buf[0..avail_len].copy_from_slice(__input);
15038 Bytes::new(&payload_buf)
15039 } else {
15040 Bytes::new(__input)
15041 };
15042 let mut __struct = Self::default();
15043 __struct.time_usec = buf.get_u64_le();
15044 __struct.lat = buf.get_i32_le();
15045 __struct.lon = buf.get_i32_le();
15046 __struct.alt = buf.get_i32_le();
15047 __struct.eph = buf.get_u16_le();
15048 __struct.epv = buf.get_u16_le();
15049 __struct.vel = buf.get_u16_le();
15050 __struct.cog = buf.get_u16_le();
15051 let tmp = buf.get_u8();
15052 __struct.fix_type =
15053 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15054 enum_type: "GpsFixType",
15055 value: tmp as u32,
15056 })?;
15057 __struct.satellites_visible = buf.get_u8();
15058 __struct.alt_ellipsoid = buf.get_i32_le();
15059 __struct.h_acc = buf.get_u32_le();
15060 __struct.v_acc = buf.get_u32_le();
15061 __struct.vel_acc = buf.get_u32_le();
15062 __struct.hdg_acc = buf.get_u32_le();
15063 __struct.yaw = buf.get_u16_le();
15064 Ok(__struct)
15065 }
15066 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15067 let mut __tmp = BytesMut::new(bytes);
15068 #[allow(clippy::absurd_extreme_comparisons)]
15069 #[allow(unused_comparisons)]
15070 if __tmp.remaining() < Self::ENCODED_LEN {
15071 panic!(
15072 "buffer is too small (need {} bytes, but got {})",
15073 Self::ENCODED_LEN,
15074 __tmp.remaining(),
15075 )
15076 }
15077 __tmp.put_u64_le(self.time_usec);
15078 __tmp.put_i32_le(self.lat);
15079 __tmp.put_i32_le(self.lon);
15080 __tmp.put_i32_le(self.alt);
15081 __tmp.put_u16_le(self.eph);
15082 __tmp.put_u16_le(self.epv);
15083 __tmp.put_u16_le(self.vel);
15084 __tmp.put_u16_le(self.cog);
15085 __tmp.put_u8(self.fix_type as u8);
15086 __tmp.put_u8(self.satellites_visible);
15087 if matches!(version, MavlinkVersion::V2) {
15088 __tmp.put_i32_le(self.alt_ellipsoid);
15089 __tmp.put_u32_le(self.h_acc);
15090 __tmp.put_u32_le(self.v_acc);
15091 __tmp.put_u32_le(self.vel_acc);
15092 __tmp.put_u32_le(self.hdg_acc);
15093 __tmp.put_u16_le(self.yaw);
15094 let len = __tmp.len();
15095 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15096 } else {
15097 __tmp.len()
15098 }
15099 }
15100}
15101#[doc = "RTCM message for injecting into the onboard GPS (used for DGPS)."]
15102#[doc = ""]
15103#[doc = "ID: 233"]
15104#[derive(Debug, Clone, PartialEq)]
15105#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15106#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15107#[cfg_attr(feature = "ts", derive(TS))]
15108#[cfg_attr(feature = "ts", ts(export))]
15109pub struct GPS_RTCM_DATA_DATA {
15110 #[doc = "LSB: 1 means message is fragmented, next 2 bits are the fragment ID, the remaining 5 bits are used for the sequence ID. Messages are only to be flushed to the GPS when the entire message has been reconstructed on the autopilot. The fragment ID specifies which order the fragments should be assembled into a buffer, while the sequence ID is used to detect a mismatch between different buffers. The buffer is considered fully reconstructed when either all 4 fragments are present, or all the fragments before the first fragment with a non full payload is received. This management is used to ensure that normal GPS operation doesn't corrupt RTCM data, and to recover from a unreliable transport delivery order."]
15111 pub flags: u8,
15112 #[doc = "data length"]
15113 pub len: u8,
15114 #[doc = "RTCM message (may be fragmented)"]
15115 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15116 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
15117 pub data: [u8; 180],
15118}
15119impl GPS_RTCM_DATA_DATA {
15120 pub const ENCODED_LEN: usize = 182usize;
15121 pub const DEFAULT: Self = Self {
15122 flags: 0_u8,
15123 len: 0_u8,
15124 data: [0_u8; 180usize],
15125 };
15126 #[cfg(feature = "arbitrary")]
15127 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15128 use arbitrary::{Arbitrary, Unstructured};
15129 let mut buf = [0u8; 1024];
15130 rng.fill_bytes(&mut buf);
15131 let mut unstructured = Unstructured::new(&buf);
15132 Self::arbitrary(&mut unstructured).unwrap_or_default()
15133 }
15134}
15135impl Default for GPS_RTCM_DATA_DATA {
15136 fn default() -> Self {
15137 Self::DEFAULT.clone()
15138 }
15139}
15140impl MessageData for GPS_RTCM_DATA_DATA {
15141 type Message = MavMessage;
15142 const ID: u32 = 233u32;
15143 const NAME: &'static str = "GPS_RTCM_DATA";
15144 const EXTRA_CRC: u8 = 35u8;
15145 const ENCODED_LEN: usize = 182usize;
15146 fn deser(
15147 _version: MavlinkVersion,
15148 __input: &[u8],
15149 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15150 let avail_len = __input.len();
15151 let mut payload_buf = [0; Self::ENCODED_LEN];
15152 let mut buf = if avail_len < Self::ENCODED_LEN {
15153 payload_buf[0..avail_len].copy_from_slice(__input);
15154 Bytes::new(&payload_buf)
15155 } else {
15156 Bytes::new(__input)
15157 };
15158 let mut __struct = Self::default();
15159 __struct.flags = buf.get_u8();
15160 __struct.len = buf.get_u8();
15161 for v in &mut __struct.data {
15162 let val = buf.get_u8();
15163 *v = val;
15164 }
15165 Ok(__struct)
15166 }
15167 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15168 let mut __tmp = BytesMut::new(bytes);
15169 #[allow(clippy::absurd_extreme_comparisons)]
15170 #[allow(unused_comparisons)]
15171 if __tmp.remaining() < Self::ENCODED_LEN {
15172 panic!(
15173 "buffer is too small (need {} bytes, but got {})",
15174 Self::ENCODED_LEN,
15175 __tmp.remaining(),
15176 )
15177 }
15178 __tmp.put_u8(self.flags);
15179 __tmp.put_u8(self.len);
15180 for val in &self.data {
15181 __tmp.put_u8(*val);
15182 }
15183 if matches!(version, MavlinkVersion::V2) {
15184 let len = __tmp.len();
15185 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15186 } else {
15187 __tmp.len()
15188 }
15189 }
15190}
15191#[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
15192#[doc = ""]
15193#[doc = "ID: 127"]
15194#[derive(Debug, Clone, PartialEq)]
15195#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15196#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15197#[cfg_attr(feature = "ts", derive(TS))]
15198#[cfg_attr(feature = "ts", ts(export))]
15199pub struct GPS_RTK_DATA {
15200 #[doc = "Time since boot of last baseline message received."]
15201 pub time_last_baseline_ms: u32,
15202 #[doc = "GPS Time of Week of last baseline"]
15203 pub tow: u32,
15204 #[doc = "Current baseline in ECEF x or NED north component."]
15205 pub baseline_a_mm: i32,
15206 #[doc = "Current baseline in ECEF y or NED east component."]
15207 pub baseline_b_mm: i32,
15208 #[doc = "Current baseline in ECEF z or NED down component."]
15209 pub baseline_c_mm: i32,
15210 #[doc = "Current estimate of baseline accuracy."]
15211 pub accuracy: u32,
15212 #[doc = "Current number of integer ambiguity hypotheses."]
15213 pub iar_num_hypotheses: i32,
15214 #[doc = "GPS Week Number of last baseline"]
15215 pub wn: u16,
15216 #[doc = "Identification of connected RTK receiver."]
15217 pub rtk_receiver_id: u8,
15218 #[doc = "GPS-specific health report for RTK data."]
15219 pub rtk_health: u8,
15220 #[doc = "Rate of baseline messages being received by GPS"]
15221 pub rtk_rate: u8,
15222 #[doc = "Current number of sats used for RTK calculation."]
15223 pub nsats: u8,
15224 #[doc = "Coordinate system of baseline"]
15225 pub baseline_coords_type: RtkBaselineCoordinateSystem,
15226}
15227impl GPS_RTK_DATA {
15228 pub const ENCODED_LEN: usize = 35usize;
15229 pub const DEFAULT: Self = Self {
15230 time_last_baseline_ms: 0_u32,
15231 tow: 0_u32,
15232 baseline_a_mm: 0_i32,
15233 baseline_b_mm: 0_i32,
15234 baseline_c_mm: 0_i32,
15235 accuracy: 0_u32,
15236 iar_num_hypotheses: 0_i32,
15237 wn: 0_u16,
15238 rtk_receiver_id: 0_u8,
15239 rtk_health: 0_u8,
15240 rtk_rate: 0_u8,
15241 nsats: 0_u8,
15242 baseline_coords_type: RtkBaselineCoordinateSystem::DEFAULT,
15243 };
15244 #[cfg(feature = "arbitrary")]
15245 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15246 use arbitrary::{Arbitrary, Unstructured};
15247 let mut buf = [0u8; 1024];
15248 rng.fill_bytes(&mut buf);
15249 let mut unstructured = Unstructured::new(&buf);
15250 Self::arbitrary(&mut unstructured).unwrap_or_default()
15251 }
15252}
15253impl Default for GPS_RTK_DATA {
15254 fn default() -> Self {
15255 Self::DEFAULT.clone()
15256 }
15257}
15258impl MessageData for GPS_RTK_DATA {
15259 type Message = MavMessage;
15260 const ID: u32 = 127u32;
15261 const NAME: &'static str = "GPS_RTK";
15262 const EXTRA_CRC: u8 = 25u8;
15263 const ENCODED_LEN: usize = 35usize;
15264 fn deser(
15265 _version: MavlinkVersion,
15266 __input: &[u8],
15267 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15268 let avail_len = __input.len();
15269 let mut payload_buf = [0; Self::ENCODED_LEN];
15270 let mut buf = if avail_len < Self::ENCODED_LEN {
15271 payload_buf[0..avail_len].copy_from_slice(__input);
15272 Bytes::new(&payload_buf)
15273 } else {
15274 Bytes::new(__input)
15275 };
15276 let mut __struct = Self::default();
15277 __struct.time_last_baseline_ms = buf.get_u32_le();
15278 __struct.tow = buf.get_u32_le();
15279 __struct.baseline_a_mm = buf.get_i32_le();
15280 __struct.baseline_b_mm = buf.get_i32_le();
15281 __struct.baseline_c_mm = buf.get_i32_le();
15282 __struct.accuracy = buf.get_u32_le();
15283 __struct.iar_num_hypotheses = buf.get_i32_le();
15284 __struct.wn = buf.get_u16_le();
15285 __struct.rtk_receiver_id = buf.get_u8();
15286 __struct.rtk_health = buf.get_u8();
15287 __struct.rtk_rate = buf.get_u8();
15288 __struct.nsats = buf.get_u8();
15289 let tmp = buf.get_u8();
15290 __struct.baseline_coords_type =
15291 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15292 enum_type: "RtkBaselineCoordinateSystem",
15293 value: tmp as u32,
15294 })?;
15295 Ok(__struct)
15296 }
15297 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15298 let mut __tmp = BytesMut::new(bytes);
15299 #[allow(clippy::absurd_extreme_comparisons)]
15300 #[allow(unused_comparisons)]
15301 if __tmp.remaining() < Self::ENCODED_LEN {
15302 panic!(
15303 "buffer is too small (need {} bytes, but got {})",
15304 Self::ENCODED_LEN,
15305 __tmp.remaining(),
15306 )
15307 }
15308 __tmp.put_u32_le(self.time_last_baseline_ms);
15309 __tmp.put_u32_le(self.tow);
15310 __tmp.put_i32_le(self.baseline_a_mm);
15311 __tmp.put_i32_le(self.baseline_b_mm);
15312 __tmp.put_i32_le(self.baseline_c_mm);
15313 __tmp.put_u32_le(self.accuracy);
15314 __tmp.put_i32_le(self.iar_num_hypotheses);
15315 __tmp.put_u16_le(self.wn);
15316 __tmp.put_u8(self.rtk_receiver_id);
15317 __tmp.put_u8(self.rtk_health);
15318 __tmp.put_u8(self.rtk_rate);
15319 __tmp.put_u8(self.nsats);
15320 __tmp.put_u8(self.baseline_coords_type as u8);
15321 if matches!(version, MavlinkVersion::V2) {
15322 let len = __tmp.len();
15323 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15324 } else {
15325 __tmp.len()
15326 }
15327 }
15328}
15329#[doc = "The positioning status, as reported by GPS. This message is intended to display status information about each satellite visible to the receiver. See message GLOBAL_POSITION_INT for the global position estimate. This message can contain information for up to 20 satellites."]
15330#[doc = ""]
15331#[doc = "ID: 25"]
15332#[derive(Debug, Clone, PartialEq)]
15333#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15334#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15335#[cfg_attr(feature = "ts", derive(TS))]
15336#[cfg_attr(feature = "ts", ts(export))]
15337pub struct GPS_STATUS_DATA {
15338 #[doc = "Number of satellites visible"]
15339 pub satellites_visible: u8,
15340 #[doc = "Global satellite ID"]
15341 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15342 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
15343 pub satellite_prn: [u8; 20],
15344 #[doc = "0: Satellite not used, 1: used for localization"]
15345 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15346 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
15347 pub satellite_used: [u8; 20],
15348 #[doc = "Elevation (0: right on top of receiver, 90: on the horizon) of satellite"]
15349 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15350 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
15351 pub satellite_elevation: [u8; 20],
15352 #[doc = "Direction of satellite, 0: 0 deg, 255: 360 deg."]
15353 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15354 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
15355 pub satellite_azimuth: [u8; 20],
15356 #[doc = "Signal to noise ratio of satellite"]
15357 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15358 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
15359 pub satellite_snr: [u8; 20],
15360}
15361impl GPS_STATUS_DATA {
15362 pub const ENCODED_LEN: usize = 101usize;
15363 pub const DEFAULT: Self = Self {
15364 satellites_visible: 0_u8,
15365 satellite_prn: [0_u8; 20usize],
15366 satellite_used: [0_u8; 20usize],
15367 satellite_elevation: [0_u8; 20usize],
15368 satellite_azimuth: [0_u8; 20usize],
15369 satellite_snr: [0_u8; 20usize],
15370 };
15371 #[cfg(feature = "arbitrary")]
15372 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15373 use arbitrary::{Arbitrary, Unstructured};
15374 let mut buf = [0u8; 1024];
15375 rng.fill_bytes(&mut buf);
15376 let mut unstructured = Unstructured::new(&buf);
15377 Self::arbitrary(&mut unstructured).unwrap_or_default()
15378 }
15379}
15380impl Default for GPS_STATUS_DATA {
15381 fn default() -> Self {
15382 Self::DEFAULT.clone()
15383 }
15384}
15385impl MessageData for GPS_STATUS_DATA {
15386 type Message = MavMessage;
15387 const ID: u32 = 25u32;
15388 const NAME: &'static str = "GPS_STATUS";
15389 const EXTRA_CRC: u8 = 23u8;
15390 const ENCODED_LEN: usize = 101usize;
15391 fn deser(
15392 _version: MavlinkVersion,
15393 __input: &[u8],
15394 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15395 let avail_len = __input.len();
15396 let mut payload_buf = [0; Self::ENCODED_LEN];
15397 let mut buf = if avail_len < Self::ENCODED_LEN {
15398 payload_buf[0..avail_len].copy_from_slice(__input);
15399 Bytes::new(&payload_buf)
15400 } else {
15401 Bytes::new(__input)
15402 };
15403 let mut __struct = Self::default();
15404 __struct.satellites_visible = buf.get_u8();
15405 for v in &mut __struct.satellite_prn {
15406 let val = buf.get_u8();
15407 *v = val;
15408 }
15409 for v in &mut __struct.satellite_used {
15410 let val = buf.get_u8();
15411 *v = val;
15412 }
15413 for v in &mut __struct.satellite_elevation {
15414 let val = buf.get_u8();
15415 *v = val;
15416 }
15417 for v in &mut __struct.satellite_azimuth {
15418 let val = buf.get_u8();
15419 *v = val;
15420 }
15421 for v in &mut __struct.satellite_snr {
15422 let val = buf.get_u8();
15423 *v = val;
15424 }
15425 Ok(__struct)
15426 }
15427 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15428 let mut __tmp = BytesMut::new(bytes);
15429 #[allow(clippy::absurd_extreme_comparisons)]
15430 #[allow(unused_comparisons)]
15431 if __tmp.remaining() < Self::ENCODED_LEN {
15432 panic!(
15433 "buffer is too small (need {} bytes, but got {})",
15434 Self::ENCODED_LEN,
15435 __tmp.remaining(),
15436 )
15437 }
15438 __tmp.put_u8(self.satellites_visible);
15439 for val in &self.satellite_prn {
15440 __tmp.put_u8(*val);
15441 }
15442 for val in &self.satellite_used {
15443 __tmp.put_u8(*val);
15444 }
15445 for val in &self.satellite_elevation {
15446 __tmp.put_u8(*val);
15447 }
15448 for val in &self.satellite_azimuth {
15449 __tmp.put_u8(*val);
15450 }
15451 for val in &self.satellite_snr {
15452 __tmp.put_u8(*val);
15453 }
15454 if matches!(version, MavlinkVersion::V2) {
15455 let len = __tmp.len();
15456 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15457 } else {
15458 __tmp.len()
15459 }
15460 }
15461}
15462#[doc = "The heartbeat message shows that a system or component is present and responding. The type and autopilot fields (along with the message component id), allow the receiving system to treat further messages from this system appropriately (e.g. by laying out the user interface based on the autopilot). This microservice is documented at <https://mavlink.io/en/services/heartbeat.html>."]
15463#[doc = ""]
15464#[doc = "ID: 0"]
15465#[derive(Debug, Clone, PartialEq)]
15466#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15467#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15468#[cfg_attr(feature = "ts", derive(TS))]
15469#[cfg_attr(feature = "ts", ts(export))]
15470pub struct HEARTBEAT_DATA {
15471 #[doc = "A bitfield for use for autopilot-specific flags"]
15472 pub custom_mode: u32,
15473 #[doc = "Vehicle or component type. For a flight controller component the vehicle type (quadrotor, helicopter, etc.). For other components the component type (e.g. camera, gimbal, etc.). This should be used in preference to component id for identifying the component type."]
15474 pub mavtype: MavType,
15475 #[doc = "Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers."]
15476 pub autopilot: MavAutopilot,
15477 #[doc = "System mode bitmap."]
15478 pub base_mode: MavModeFlag,
15479 #[doc = "System status flag."]
15480 pub system_status: MavState,
15481 #[doc = "MAVLink version, not writable by user, gets added by protocol because of magic data type: uint8_t_mavlink_version"]
15482 pub mavlink_version: u8,
15483}
15484impl HEARTBEAT_DATA {
15485 pub const ENCODED_LEN: usize = 9usize;
15486 pub const DEFAULT: Self = Self {
15487 custom_mode: 0_u32,
15488 mavtype: MavType::DEFAULT,
15489 autopilot: MavAutopilot::DEFAULT,
15490 base_mode: MavModeFlag::DEFAULT,
15491 system_status: MavState::DEFAULT,
15492 mavlink_version: MINOR_MAVLINK_VERSION,
15493 };
15494 #[cfg(feature = "arbitrary")]
15495 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15496 use arbitrary::{Arbitrary, Unstructured};
15497 let mut buf = [0u8; 1024];
15498 rng.fill_bytes(&mut buf);
15499 let mut unstructured = Unstructured::new(&buf);
15500 Self::arbitrary(&mut unstructured).unwrap_or_default()
15501 }
15502}
15503impl Default for HEARTBEAT_DATA {
15504 fn default() -> Self {
15505 Self::DEFAULT.clone()
15506 }
15507}
15508impl MessageData for HEARTBEAT_DATA {
15509 type Message = MavMessage;
15510 const ID: u32 = 0u32;
15511 const NAME: &'static str = "HEARTBEAT";
15512 const EXTRA_CRC: u8 = 50u8;
15513 const ENCODED_LEN: usize = 9usize;
15514 fn deser(
15515 _version: MavlinkVersion,
15516 __input: &[u8],
15517 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15518 let avail_len = __input.len();
15519 let mut payload_buf = [0; Self::ENCODED_LEN];
15520 let mut buf = if avail_len < Self::ENCODED_LEN {
15521 payload_buf[0..avail_len].copy_from_slice(__input);
15522 Bytes::new(&payload_buf)
15523 } else {
15524 Bytes::new(__input)
15525 };
15526 let mut __struct = Self::default();
15527 __struct.custom_mode = buf.get_u32_le();
15528 let tmp = buf.get_u8();
15529 __struct.mavtype =
15530 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15531 enum_type: "MavType",
15532 value: tmp as u32,
15533 })?;
15534 let tmp = buf.get_u8();
15535 __struct.autopilot =
15536 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15537 enum_type: "MavAutopilot",
15538 value: tmp as u32,
15539 })?;
15540 let tmp = buf.get_u8();
15541 __struct.base_mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
15542 ::mavlink_core::error::ParserError::InvalidFlag {
15543 flag_type: "MavModeFlag",
15544 value: tmp as u32,
15545 },
15546 )?;
15547 let tmp = buf.get_u8();
15548 __struct.system_status =
15549 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15550 enum_type: "MavState",
15551 value: tmp as u32,
15552 })?;
15553 __struct.mavlink_version = buf.get_u8();
15554 Ok(__struct)
15555 }
15556 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15557 let mut __tmp = BytesMut::new(bytes);
15558 #[allow(clippy::absurd_extreme_comparisons)]
15559 #[allow(unused_comparisons)]
15560 if __tmp.remaining() < Self::ENCODED_LEN {
15561 panic!(
15562 "buffer is too small (need {} bytes, but got {})",
15563 Self::ENCODED_LEN,
15564 __tmp.remaining(),
15565 )
15566 }
15567 __tmp.put_u32_le(self.custom_mode);
15568 __tmp.put_u8(self.mavtype as u8);
15569 __tmp.put_u8(self.autopilot as u8);
15570 __tmp.put_u8(self.base_mode.bits());
15571 __tmp.put_u8(self.system_status as u8);
15572 __tmp.put_u8(self.mavlink_version);
15573 if matches!(version, MavlinkVersion::V2) {
15574 let len = __tmp.len();
15575 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15576 } else {
15577 __tmp.len()
15578 }
15579 }
15580}
15581#[doc = "The IMU readings in SI units in NED body frame."]
15582#[doc = ""]
15583#[doc = "ID: 105"]
15584#[derive(Debug, Clone, PartialEq)]
15585#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15586#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15587#[cfg_attr(feature = "ts", derive(TS))]
15588#[cfg_attr(feature = "ts", ts(export))]
15589pub struct HIGHRES_IMU_DATA {
15590 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15591 pub time_usec: u64,
15592 #[doc = "X acceleration"]
15593 pub xacc: f32,
15594 #[doc = "Y acceleration"]
15595 pub yacc: f32,
15596 #[doc = "Z acceleration"]
15597 pub zacc: f32,
15598 #[doc = "Angular speed around X axis"]
15599 pub xgyro: f32,
15600 #[doc = "Angular speed around Y axis"]
15601 pub ygyro: f32,
15602 #[doc = "Angular speed around Z axis"]
15603 pub zgyro: f32,
15604 #[doc = "X Magnetic field"]
15605 pub xmag: f32,
15606 #[doc = "Y Magnetic field"]
15607 pub ymag: f32,
15608 #[doc = "Z Magnetic field"]
15609 pub zmag: f32,
15610 #[doc = "Absolute pressure"]
15611 pub abs_pressure: f32,
15612 #[doc = "Differential pressure"]
15613 pub diff_pressure: f32,
15614 #[doc = "Altitude calculated from pressure"]
15615 pub pressure_alt: f32,
15616 #[doc = "Temperature"]
15617 pub temperature: f32,
15618 #[doc = "Bitmap for fields that have updated since last message"]
15619 pub fields_updated: HighresImuUpdatedFlags,
15620 #[doc = "Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0)"]
15621 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15622 pub id: u8,
15623}
15624impl HIGHRES_IMU_DATA {
15625 pub const ENCODED_LEN: usize = 63usize;
15626 pub const DEFAULT: Self = Self {
15627 time_usec: 0_u64,
15628 xacc: 0.0_f32,
15629 yacc: 0.0_f32,
15630 zacc: 0.0_f32,
15631 xgyro: 0.0_f32,
15632 ygyro: 0.0_f32,
15633 zgyro: 0.0_f32,
15634 xmag: 0.0_f32,
15635 ymag: 0.0_f32,
15636 zmag: 0.0_f32,
15637 abs_pressure: 0.0_f32,
15638 diff_pressure: 0.0_f32,
15639 pressure_alt: 0.0_f32,
15640 temperature: 0.0_f32,
15641 fields_updated: HighresImuUpdatedFlags::DEFAULT,
15642 id: 0_u8,
15643 };
15644 #[cfg(feature = "arbitrary")]
15645 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15646 use arbitrary::{Arbitrary, Unstructured};
15647 let mut buf = [0u8; 1024];
15648 rng.fill_bytes(&mut buf);
15649 let mut unstructured = Unstructured::new(&buf);
15650 Self::arbitrary(&mut unstructured).unwrap_or_default()
15651 }
15652}
15653impl Default for HIGHRES_IMU_DATA {
15654 fn default() -> Self {
15655 Self::DEFAULT.clone()
15656 }
15657}
15658impl MessageData for HIGHRES_IMU_DATA {
15659 type Message = MavMessage;
15660 const ID: u32 = 105u32;
15661 const NAME: &'static str = "HIGHRES_IMU";
15662 const EXTRA_CRC: u8 = 93u8;
15663 const ENCODED_LEN: usize = 63usize;
15664 fn deser(
15665 _version: MavlinkVersion,
15666 __input: &[u8],
15667 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15668 let avail_len = __input.len();
15669 let mut payload_buf = [0; Self::ENCODED_LEN];
15670 let mut buf = if avail_len < Self::ENCODED_LEN {
15671 payload_buf[0..avail_len].copy_from_slice(__input);
15672 Bytes::new(&payload_buf)
15673 } else {
15674 Bytes::new(__input)
15675 };
15676 let mut __struct = Self::default();
15677 __struct.time_usec = buf.get_u64_le();
15678 __struct.xacc = buf.get_f32_le();
15679 __struct.yacc = buf.get_f32_le();
15680 __struct.zacc = buf.get_f32_le();
15681 __struct.xgyro = buf.get_f32_le();
15682 __struct.ygyro = buf.get_f32_le();
15683 __struct.zgyro = buf.get_f32_le();
15684 __struct.xmag = buf.get_f32_le();
15685 __struct.ymag = buf.get_f32_le();
15686 __struct.zmag = buf.get_f32_le();
15687 __struct.abs_pressure = buf.get_f32_le();
15688 __struct.diff_pressure = buf.get_f32_le();
15689 __struct.pressure_alt = buf.get_f32_le();
15690 __struct.temperature = buf.get_f32_le();
15691 let tmp = buf.get_u16_le();
15692 __struct.fields_updated = HighresImuUpdatedFlags::from_bits(
15693 tmp & HighresImuUpdatedFlags::all().bits(),
15694 )
15695 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
15696 flag_type: "HighresImuUpdatedFlags",
15697 value: tmp as u32,
15698 })?;
15699 __struct.id = buf.get_u8();
15700 Ok(__struct)
15701 }
15702 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15703 let mut __tmp = BytesMut::new(bytes);
15704 #[allow(clippy::absurd_extreme_comparisons)]
15705 #[allow(unused_comparisons)]
15706 if __tmp.remaining() < Self::ENCODED_LEN {
15707 panic!(
15708 "buffer is too small (need {} bytes, but got {})",
15709 Self::ENCODED_LEN,
15710 __tmp.remaining(),
15711 )
15712 }
15713 __tmp.put_u64_le(self.time_usec);
15714 __tmp.put_f32_le(self.xacc);
15715 __tmp.put_f32_le(self.yacc);
15716 __tmp.put_f32_le(self.zacc);
15717 __tmp.put_f32_le(self.xgyro);
15718 __tmp.put_f32_le(self.ygyro);
15719 __tmp.put_f32_le(self.zgyro);
15720 __tmp.put_f32_le(self.xmag);
15721 __tmp.put_f32_le(self.ymag);
15722 __tmp.put_f32_le(self.zmag);
15723 __tmp.put_f32_le(self.abs_pressure);
15724 __tmp.put_f32_le(self.diff_pressure);
15725 __tmp.put_f32_le(self.pressure_alt);
15726 __tmp.put_f32_le(self.temperature);
15727 __tmp.put_u16_le(self.fields_updated.bits());
15728 if matches!(version, MavlinkVersion::V2) {
15729 __tmp.put_u8(self.id);
15730 let len = __tmp.len();
15731 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15732 } else {
15733 __tmp.len()
15734 }
15735 }
15736}
15737#[deprecated = " See `HIGH_LATENCY2` (Deprecated since 2020-10)"]
15738#[doc = "Message appropriate for high latency connections like Iridium."]
15739#[doc = ""]
15740#[doc = "ID: 234"]
15741#[derive(Debug, Clone, PartialEq)]
15742#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15743#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15744#[cfg_attr(feature = "ts", derive(TS))]
15745#[cfg_attr(feature = "ts", ts(export))]
15746pub struct HIGH_LATENCY_DATA {
15747 #[doc = "A bitfield for use for autopilot-specific flags."]
15748 pub custom_mode: u32,
15749 #[doc = "Latitude"]
15750 pub latitude: i32,
15751 #[doc = "Longitude"]
15752 pub longitude: i32,
15753 #[doc = "roll"]
15754 pub roll: i16,
15755 #[doc = "pitch"]
15756 pub pitch: i16,
15757 #[doc = "heading"]
15758 pub heading: u16,
15759 #[doc = "heading setpoint"]
15760 pub heading_sp: i16,
15761 #[doc = "Altitude above mean sea level"]
15762 pub altitude_amsl: i16,
15763 #[doc = "Altitude setpoint relative to the home position"]
15764 pub altitude_sp: i16,
15765 #[doc = "distance to target"]
15766 pub wp_distance: u16,
15767 #[doc = "Bitmap of enabled system modes."]
15768 pub base_mode: MavModeFlag,
15769 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
15770 pub landed_state: MavLandedState,
15771 #[doc = "throttle (percentage)"]
15772 pub throttle: i8,
15773 #[doc = "airspeed"]
15774 pub airspeed: u8,
15775 #[doc = "airspeed setpoint"]
15776 pub airspeed_sp: u8,
15777 #[doc = "groundspeed"]
15778 pub groundspeed: u8,
15779 #[doc = "climb rate"]
15780 pub climb_rate: i8,
15781 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
15782 pub gps_nsat: u8,
15783 #[doc = "GPS Fix type."]
15784 pub gps_fix_type: GpsFixType,
15785 #[doc = "Remaining battery (percentage)"]
15786 pub battery_remaining: u8,
15787 #[doc = "Autopilot temperature (degrees C)"]
15788 pub temperature: i8,
15789 #[doc = "Air temperature (degrees C) from airspeed sensor"]
15790 pub temperature_air: i8,
15791 #[doc = "failsafe (each bit represents a failsafe where 0=ok, 1=failsafe active (bit0:RC, bit1:batt, bit2:GPS, bit3:GCS, bit4:fence)"]
15792 pub failsafe: u8,
15793 #[doc = "current waypoint number"]
15794 pub wp_num: u8,
15795}
15796impl HIGH_LATENCY_DATA {
15797 pub const ENCODED_LEN: usize = 40usize;
15798 pub const DEFAULT: Self = Self {
15799 custom_mode: 0_u32,
15800 latitude: 0_i32,
15801 longitude: 0_i32,
15802 roll: 0_i16,
15803 pitch: 0_i16,
15804 heading: 0_u16,
15805 heading_sp: 0_i16,
15806 altitude_amsl: 0_i16,
15807 altitude_sp: 0_i16,
15808 wp_distance: 0_u16,
15809 base_mode: MavModeFlag::DEFAULT,
15810 landed_state: MavLandedState::DEFAULT,
15811 throttle: 0_i8,
15812 airspeed: 0_u8,
15813 airspeed_sp: 0_u8,
15814 groundspeed: 0_u8,
15815 climb_rate: 0_i8,
15816 gps_nsat: 0_u8,
15817 gps_fix_type: GpsFixType::DEFAULT,
15818 battery_remaining: 0_u8,
15819 temperature: 0_i8,
15820 temperature_air: 0_i8,
15821 failsafe: 0_u8,
15822 wp_num: 0_u8,
15823 };
15824 #[cfg(feature = "arbitrary")]
15825 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15826 use arbitrary::{Arbitrary, Unstructured};
15827 let mut buf = [0u8; 1024];
15828 rng.fill_bytes(&mut buf);
15829 let mut unstructured = Unstructured::new(&buf);
15830 Self::arbitrary(&mut unstructured).unwrap_or_default()
15831 }
15832}
15833impl Default for HIGH_LATENCY_DATA {
15834 fn default() -> Self {
15835 Self::DEFAULT.clone()
15836 }
15837}
15838impl MessageData for HIGH_LATENCY_DATA {
15839 type Message = MavMessage;
15840 const ID: u32 = 234u32;
15841 const NAME: &'static str = "HIGH_LATENCY";
15842 const EXTRA_CRC: u8 = 150u8;
15843 const ENCODED_LEN: usize = 40usize;
15844 fn deser(
15845 _version: MavlinkVersion,
15846 __input: &[u8],
15847 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15848 let avail_len = __input.len();
15849 let mut payload_buf = [0; Self::ENCODED_LEN];
15850 let mut buf = if avail_len < Self::ENCODED_LEN {
15851 payload_buf[0..avail_len].copy_from_slice(__input);
15852 Bytes::new(&payload_buf)
15853 } else {
15854 Bytes::new(__input)
15855 };
15856 let mut __struct = Self::default();
15857 __struct.custom_mode = buf.get_u32_le();
15858 __struct.latitude = buf.get_i32_le();
15859 __struct.longitude = buf.get_i32_le();
15860 __struct.roll = buf.get_i16_le();
15861 __struct.pitch = buf.get_i16_le();
15862 __struct.heading = buf.get_u16_le();
15863 __struct.heading_sp = buf.get_i16_le();
15864 __struct.altitude_amsl = buf.get_i16_le();
15865 __struct.altitude_sp = buf.get_i16_le();
15866 __struct.wp_distance = buf.get_u16_le();
15867 let tmp = buf.get_u8();
15868 __struct.base_mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
15869 ::mavlink_core::error::ParserError::InvalidFlag {
15870 flag_type: "MavModeFlag",
15871 value: tmp as u32,
15872 },
15873 )?;
15874 let tmp = buf.get_u8();
15875 __struct.landed_state =
15876 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15877 enum_type: "MavLandedState",
15878 value: tmp as u32,
15879 })?;
15880 __struct.throttle = buf.get_i8();
15881 __struct.airspeed = buf.get_u8();
15882 __struct.airspeed_sp = buf.get_u8();
15883 __struct.groundspeed = buf.get_u8();
15884 __struct.climb_rate = buf.get_i8();
15885 __struct.gps_nsat = buf.get_u8();
15886 let tmp = buf.get_u8();
15887 __struct.gps_fix_type =
15888 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15889 enum_type: "GpsFixType",
15890 value: tmp as u32,
15891 })?;
15892 __struct.battery_remaining = buf.get_u8();
15893 __struct.temperature = buf.get_i8();
15894 __struct.temperature_air = buf.get_i8();
15895 __struct.failsafe = buf.get_u8();
15896 __struct.wp_num = buf.get_u8();
15897 Ok(__struct)
15898 }
15899 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15900 let mut __tmp = BytesMut::new(bytes);
15901 #[allow(clippy::absurd_extreme_comparisons)]
15902 #[allow(unused_comparisons)]
15903 if __tmp.remaining() < Self::ENCODED_LEN {
15904 panic!(
15905 "buffer is too small (need {} bytes, but got {})",
15906 Self::ENCODED_LEN,
15907 __tmp.remaining(),
15908 )
15909 }
15910 __tmp.put_u32_le(self.custom_mode);
15911 __tmp.put_i32_le(self.latitude);
15912 __tmp.put_i32_le(self.longitude);
15913 __tmp.put_i16_le(self.roll);
15914 __tmp.put_i16_le(self.pitch);
15915 __tmp.put_u16_le(self.heading);
15916 __tmp.put_i16_le(self.heading_sp);
15917 __tmp.put_i16_le(self.altitude_amsl);
15918 __tmp.put_i16_le(self.altitude_sp);
15919 __tmp.put_u16_le(self.wp_distance);
15920 __tmp.put_u8(self.base_mode.bits());
15921 __tmp.put_u8(self.landed_state as u8);
15922 __tmp.put_i8(self.throttle);
15923 __tmp.put_u8(self.airspeed);
15924 __tmp.put_u8(self.airspeed_sp);
15925 __tmp.put_u8(self.groundspeed);
15926 __tmp.put_i8(self.climb_rate);
15927 __tmp.put_u8(self.gps_nsat);
15928 __tmp.put_u8(self.gps_fix_type as u8);
15929 __tmp.put_u8(self.battery_remaining);
15930 __tmp.put_i8(self.temperature);
15931 __tmp.put_i8(self.temperature_air);
15932 __tmp.put_u8(self.failsafe);
15933 __tmp.put_u8(self.wp_num);
15934 if matches!(version, MavlinkVersion::V2) {
15935 let len = __tmp.len();
15936 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15937 } else {
15938 __tmp.len()
15939 }
15940 }
15941}
15942#[doc = "Message appropriate for high latency connections like Iridium (version 2)."]
15943#[doc = ""]
15944#[doc = "ID: 235"]
15945#[derive(Debug, Clone, PartialEq)]
15946#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15947#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15948#[cfg_attr(feature = "ts", derive(TS))]
15949#[cfg_attr(feature = "ts", ts(export))]
15950pub struct HIGH_LATENCY2_DATA {
15951 #[doc = "Timestamp (milliseconds since boot or Unix epoch)"]
15952 pub timestamp: u32,
15953 #[doc = "Latitude"]
15954 pub latitude: i32,
15955 #[doc = "Longitude"]
15956 pub longitude: i32,
15957 #[doc = "A bitfield for use for autopilot-specific flags (2 byte version)."]
15958 pub custom_mode: u16,
15959 #[doc = "Altitude above mean sea level"]
15960 pub altitude: i16,
15961 #[doc = "Altitude setpoint"]
15962 pub target_altitude: i16,
15963 #[doc = "Distance to target waypoint or position"]
15964 pub target_distance: u16,
15965 #[doc = "Current waypoint number"]
15966 pub wp_num: u16,
15967 #[doc = "Bitmap of failure flags."]
15968 pub failure_flags: HlFailureFlag,
15969 #[doc = "Type of the MAV (quadrotor, helicopter, etc.)"]
15970 pub mavtype: MavType,
15971 #[doc = "Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers."]
15972 pub autopilot: MavAutopilot,
15973 #[doc = "Heading"]
15974 pub heading: u8,
15975 #[doc = "Heading setpoint"]
15976 pub target_heading: u8,
15977 #[doc = "Throttle"]
15978 pub throttle: u8,
15979 #[doc = "Airspeed"]
15980 pub airspeed: u8,
15981 #[doc = "Airspeed setpoint"]
15982 pub airspeed_sp: u8,
15983 #[doc = "Groundspeed"]
15984 pub groundspeed: u8,
15985 #[doc = "Windspeed"]
15986 pub windspeed: u8,
15987 #[doc = "Wind heading"]
15988 pub wind_heading: u8,
15989 #[doc = "Maximum error horizontal position since last message"]
15990 pub eph: u8,
15991 #[doc = "Maximum error vertical position since last message"]
15992 pub epv: u8,
15993 #[doc = "Air temperature"]
15994 pub temperature_air: i8,
15995 #[doc = "Maximum climb rate magnitude since last message"]
15996 pub climb_rate: i8,
15997 #[doc = "Battery level (-1 if field not provided)."]
15998 pub battery: i8,
15999 #[doc = "Field for custom payload."]
16000 pub custom0: i8,
16001 #[doc = "Field for custom payload."]
16002 pub custom1: i8,
16003 #[doc = "Field for custom payload."]
16004 pub custom2: i8,
16005}
16006impl HIGH_LATENCY2_DATA {
16007 pub const ENCODED_LEN: usize = 42usize;
16008 pub const DEFAULT: Self = Self {
16009 timestamp: 0_u32,
16010 latitude: 0_i32,
16011 longitude: 0_i32,
16012 custom_mode: 0_u16,
16013 altitude: 0_i16,
16014 target_altitude: 0_i16,
16015 target_distance: 0_u16,
16016 wp_num: 0_u16,
16017 failure_flags: HlFailureFlag::DEFAULT,
16018 mavtype: MavType::DEFAULT,
16019 autopilot: MavAutopilot::DEFAULT,
16020 heading: 0_u8,
16021 target_heading: 0_u8,
16022 throttle: 0_u8,
16023 airspeed: 0_u8,
16024 airspeed_sp: 0_u8,
16025 groundspeed: 0_u8,
16026 windspeed: 0_u8,
16027 wind_heading: 0_u8,
16028 eph: 0_u8,
16029 epv: 0_u8,
16030 temperature_air: 0_i8,
16031 climb_rate: 0_i8,
16032 battery: 0_i8,
16033 custom0: 0_i8,
16034 custom1: 0_i8,
16035 custom2: 0_i8,
16036 };
16037 #[cfg(feature = "arbitrary")]
16038 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16039 use arbitrary::{Arbitrary, Unstructured};
16040 let mut buf = [0u8; 1024];
16041 rng.fill_bytes(&mut buf);
16042 let mut unstructured = Unstructured::new(&buf);
16043 Self::arbitrary(&mut unstructured).unwrap_or_default()
16044 }
16045}
16046impl Default for HIGH_LATENCY2_DATA {
16047 fn default() -> Self {
16048 Self::DEFAULT.clone()
16049 }
16050}
16051impl MessageData for HIGH_LATENCY2_DATA {
16052 type Message = MavMessage;
16053 const ID: u32 = 235u32;
16054 const NAME: &'static str = "HIGH_LATENCY2";
16055 const EXTRA_CRC: u8 = 179u8;
16056 const ENCODED_LEN: usize = 42usize;
16057 fn deser(
16058 _version: MavlinkVersion,
16059 __input: &[u8],
16060 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16061 let avail_len = __input.len();
16062 let mut payload_buf = [0; Self::ENCODED_LEN];
16063 let mut buf = if avail_len < Self::ENCODED_LEN {
16064 payload_buf[0..avail_len].copy_from_slice(__input);
16065 Bytes::new(&payload_buf)
16066 } else {
16067 Bytes::new(__input)
16068 };
16069 let mut __struct = Self::default();
16070 __struct.timestamp = buf.get_u32_le();
16071 __struct.latitude = buf.get_i32_le();
16072 __struct.longitude = buf.get_i32_le();
16073 __struct.custom_mode = buf.get_u16_le();
16074 __struct.altitude = buf.get_i16_le();
16075 __struct.target_altitude = buf.get_i16_le();
16076 __struct.target_distance = buf.get_u16_le();
16077 __struct.wp_num = buf.get_u16_le();
16078 let tmp = buf.get_u16_le();
16079 __struct.failure_flags = HlFailureFlag::from_bits(tmp & HlFailureFlag::all().bits())
16080 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
16081 flag_type: "HlFailureFlag",
16082 value: tmp as u32,
16083 })?;
16084 let tmp = buf.get_u8();
16085 __struct.mavtype =
16086 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16087 enum_type: "MavType",
16088 value: tmp as u32,
16089 })?;
16090 let tmp = buf.get_u8();
16091 __struct.autopilot =
16092 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16093 enum_type: "MavAutopilot",
16094 value: tmp as u32,
16095 })?;
16096 __struct.heading = buf.get_u8();
16097 __struct.target_heading = buf.get_u8();
16098 __struct.throttle = buf.get_u8();
16099 __struct.airspeed = buf.get_u8();
16100 __struct.airspeed_sp = buf.get_u8();
16101 __struct.groundspeed = buf.get_u8();
16102 __struct.windspeed = buf.get_u8();
16103 __struct.wind_heading = buf.get_u8();
16104 __struct.eph = buf.get_u8();
16105 __struct.epv = buf.get_u8();
16106 __struct.temperature_air = buf.get_i8();
16107 __struct.climb_rate = buf.get_i8();
16108 __struct.battery = buf.get_i8();
16109 __struct.custom0 = buf.get_i8();
16110 __struct.custom1 = buf.get_i8();
16111 __struct.custom2 = buf.get_i8();
16112 Ok(__struct)
16113 }
16114 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16115 let mut __tmp = BytesMut::new(bytes);
16116 #[allow(clippy::absurd_extreme_comparisons)]
16117 #[allow(unused_comparisons)]
16118 if __tmp.remaining() < Self::ENCODED_LEN {
16119 panic!(
16120 "buffer is too small (need {} bytes, but got {})",
16121 Self::ENCODED_LEN,
16122 __tmp.remaining(),
16123 )
16124 }
16125 __tmp.put_u32_le(self.timestamp);
16126 __tmp.put_i32_le(self.latitude);
16127 __tmp.put_i32_le(self.longitude);
16128 __tmp.put_u16_le(self.custom_mode);
16129 __tmp.put_i16_le(self.altitude);
16130 __tmp.put_i16_le(self.target_altitude);
16131 __tmp.put_u16_le(self.target_distance);
16132 __tmp.put_u16_le(self.wp_num);
16133 __tmp.put_u16_le(self.failure_flags.bits());
16134 __tmp.put_u8(self.mavtype as u8);
16135 __tmp.put_u8(self.autopilot as u8);
16136 __tmp.put_u8(self.heading);
16137 __tmp.put_u8(self.target_heading);
16138 __tmp.put_u8(self.throttle);
16139 __tmp.put_u8(self.airspeed);
16140 __tmp.put_u8(self.airspeed_sp);
16141 __tmp.put_u8(self.groundspeed);
16142 __tmp.put_u8(self.windspeed);
16143 __tmp.put_u8(self.wind_heading);
16144 __tmp.put_u8(self.eph);
16145 __tmp.put_u8(self.epv);
16146 __tmp.put_i8(self.temperature_air);
16147 __tmp.put_i8(self.climb_rate);
16148 __tmp.put_i8(self.battery);
16149 __tmp.put_i8(self.custom0);
16150 __tmp.put_i8(self.custom1);
16151 __tmp.put_i8(self.custom2);
16152 if matches!(version, MavlinkVersion::V2) {
16153 let len = __tmp.len();
16154 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16155 } else {
16156 __tmp.len()
16157 }
16158 }
16159}
16160#[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_CONTROLS."]
16161#[doc = ""]
16162#[doc = "ID: 93"]
16163#[derive(Debug, Clone, PartialEq)]
16164#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16165#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16166#[cfg_attr(feature = "ts", derive(TS))]
16167#[cfg_attr(feature = "ts", ts(export))]
16168pub struct HIL_ACTUATOR_CONTROLS_DATA {
16169 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16170 pub time_usec: u64,
16171 #[doc = "Flags bitmask."]
16172 pub flags: HilActuatorControlsFlags,
16173 #[doc = "Control outputs -1 .. 1. Channel assignment depends on the simulated hardware."]
16174 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16175 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
16176 pub controls: [f32; 16],
16177 #[doc = "System mode. Includes arming state."]
16178 pub mode: MavModeFlag,
16179}
16180impl HIL_ACTUATOR_CONTROLS_DATA {
16181 pub const ENCODED_LEN: usize = 81usize;
16182 pub const DEFAULT: Self = Self {
16183 time_usec: 0_u64,
16184 flags: HilActuatorControlsFlags::DEFAULT,
16185 controls: [0.0_f32; 16usize],
16186 mode: MavModeFlag::DEFAULT,
16187 };
16188 #[cfg(feature = "arbitrary")]
16189 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16190 use arbitrary::{Arbitrary, Unstructured};
16191 let mut buf = [0u8; 1024];
16192 rng.fill_bytes(&mut buf);
16193 let mut unstructured = Unstructured::new(&buf);
16194 Self::arbitrary(&mut unstructured).unwrap_or_default()
16195 }
16196}
16197impl Default for HIL_ACTUATOR_CONTROLS_DATA {
16198 fn default() -> Self {
16199 Self::DEFAULT.clone()
16200 }
16201}
16202impl MessageData for HIL_ACTUATOR_CONTROLS_DATA {
16203 type Message = MavMessage;
16204 const ID: u32 = 93u32;
16205 const NAME: &'static str = "HIL_ACTUATOR_CONTROLS";
16206 const EXTRA_CRC: u8 = 47u8;
16207 const ENCODED_LEN: usize = 81usize;
16208 fn deser(
16209 _version: MavlinkVersion,
16210 __input: &[u8],
16211 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16212 let avail_len = __input.len();
16213 let mut payload_buf = [0; Self::ENCODED_LEN];
16214 let mut buf = if avail_len < Self::ENCODED_LEN {
16215 payload_buf[0..avail_len].copy_from_slice(__input);
16216 Bytes::new(&payload_buf)
16217 } else {
16218 Bytes::new(__input)
16219 };
16220 let mut __struct = Self::default();
16221 __struct.time_usec = buf.get_u64_le();
16222 let tmp = buf.get_u64_le();
16223 __struct.flags =
16224 HilActuatorControlsFlags::from_bits(tmp & HilActuatorControlsFlags::all().bits())
16225 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
16226 flag_type: "HilActuatorControlsFlags",
16227 value: tmp as u32,
16228 })?;
16229 for v in &mut __struct.controls {
16230 let val = buf.get_f32_le();
16231 *v = val;
16232 }
16233 let tmp = buf.get_u8();
16234 __struct.mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
16235 ::mavlink_core::error::ParserError::InvalidFlag {
16236 flag_type: "MavModeFlag",
16237 value: tmp as u32,
16238 },
16239 )?;
16240 Ok(__struct)
16241 }
16242 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16243 let mut __tmp = BytesMut::new(bytes);
16244 #[allow(clippy::absurd_extreme_comparisons)]
16245 #[allow(unused_comparisons)]
16246 if __tmp.remaining() < Self::ENCODED_LEN {
16247 panic!(
16248 "buffer is too small (need {} bytes, but got {})",
16249 Self::ENCODED_LEN,
16250 __tmp.remaining(),
16251 )
16252 }
16253 __tmp.put_u64_le(self.time_usec);
16254 __tmp.put_u64_le(self.flags.bits());
16255 for val in &self.controls {
16256 __tmp.put_f32_le(*val);
16257 }
16258 __tmp.put_u8(self.mode.bits());
16259 if matches!(version, MavlinkVersion::V2) {
16260 let len = __tmp.len();
16261 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16262 } else {
16263 __tmp.len()
16264 }
16265 }
16266}
16267#[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_ACTUATOR_CONTROLS."]
16268#[doc = ""]
16269#[doc = "ID: 91"]
16270#[derive(Debug, Clone, PartialEq)]
16271#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16272#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16273#[cfg_attr(feature = "ts", derive(TS))]
16274#[cfg_attr(feature = "ts", ts(export))]
16275pub struct HIL_CONTROLS_DATA {
16276 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16277 pub time_usec: u64,
16278 #[doc = "Control output -1 .. 1"]
16279 pub roll_ailerons: f32,
16280 #[doc = "Control output -1 .. 1"]
16281 pub pitch_elevator: f32,
16282 #[doc = "Control output -1 .. 1"]
16283 pub yaw_rudder: f32,
16284 #[doc = "Throttle 0 .. 1"]
16285 pub throttle: f32,
16286 #[doc = "Aux 1, -1 .. 1"]
16287 pub aux1: f32,
16288 #[doc = "Aux 2, -1 .. 1"]
16289 pub aux2: f32,
16290 #[doc = "Aux 3, -1 .. 1"]
16291 pub aux3: f32,
16292 #[doc = "Aux 4, -1 .. 1"]
16293 pub aux4: f32,
16294 #[doc = "System mode."]
16295 pub mode: MavMode,
16296 #[doc = "Navigation mode (MAV_NAV_MODE)"]
16297 pub nav_mode: u8,
16298}
16299impl HIL_CONTROLS_DATA {
16300 pub const ENCODED_LEN: usize = 42usize;
16301 pub const DEFAULT: Self = Self {
16302 time_usec: 0_u64,
16303 roll_ailerons: 0.0_f32,
16304 pitch_elevator: 0.0_f32,
16305 yaw_rudder: 0.0_f32,
16306 throttle: 0.0_f32,
16307 aux1: 0.0_f32,
16308 aux2: 0.0_f32,
16309 aux3: 0.0_f32,
16310 aux4: 0.0_f32,
16311 mode: MavMode::DEFAULT,
16312 nav_mode: 0_u8,
16313 };
16314 #[cfg(feature = "arbitrary")]
16315 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16316 use arbitrary::{Arbitrary, Unstructured};
16317 let mut buf = [0u8; 1024];
16318 rng.fill_bytes(&mut buf);
16319 let mut unstructured = Unstructured::new(&buf);
16320 Self::arbitrary(&mut unstructured).unwrap_or_default()
16321 }
16322}
16323impl Default for HIL_CONTROLS_DATA {
16324 fn default() -> Self {
16325 Self::DEFAULT.clone()
16326 }
16327}
16328impl MessageData for HIL_CONTROLS_DATA {
16329 type Message = MavMessage;
16330 const ID: u32 = 91u32;
16331 const NAME: &'static str = "HIL_CONTROLS";
16332 const EXTRA_CRC: u8 = 63u8;
16333 const ENCODED_LEN: usize = 42usize;
16334 fn deser(
16335 _version: MavlinkVersion,
16336 __input: &[u8],
16337 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16338 let avail_len = __input.len();
16339 let mut payload_buf = [0; Self::ENCODED_LEN];
16340 let mut buf = if avail_len < Self::ENCODED_LEN {
16341 payload_buf[0..avail_len].copy_from_slice(__input);
16342 Bytes::new(&payload_buf)
16343 } else {
16344 Bytes::new(__input)
16345 };
16346 let mut __struct = Self::default();
16347 __struct.time_usec = buf.get_u64_le();
16348 __struct.roll_ailerons = buf.get_f32_le();
16349 __struct.pitch_elevator = buf.get_f32_le();
16350 __struct.yaw_rudder = buf.get_f32_le();
16351 __struct.throttle = buf.get_f32_le();
16352 __struct.aux1 = buf.get_f32_le();
16353 __struct.aux2 = buf.get_f32_le();
16354 __struct.aux3 = buf.get_f32_le();
16355 __struct.aux4 = buf.get_f32_le();
16356 let tmp = buf.get_u8();
16357 __struct.mode =
16358 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16359 enum_type: "MavMode",
16360 value: tmp as u32,
16361 })?;
16362 __struct.nav_mode = buf.get_u8();
16363 Ok(__struct)
16364 }
16365 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16366 let mut __tmp = BytesMut::new(bytes);
16367 #[allow(clippy::absurd_extreme_comparisons)]
16368 #[allow(unused_comparisons)]
16369 if __tmp.remaining() < Self::ENCODED_LEN {
16370 panic!(
16371 "buffer is too small (need {} bytes, but got {})",
16372 Self::ENCODED_LEN,
16373 __tmp.remaining(),
16374 )
16375 }
16376 __tmp.put_u64_le(self.time_usec);
16377 __tmp.put_f32_le(self.roll_ailerons);
16378 __tmp.put_f32_le(self.pitch_elevator);
16379 __tmp.put_f32_le(self.yaw_rudder);
16380 __tmp.put_f32_le(self.throttle);
16381 __tmp.put_f32_le(self.aux1);
16382 __tmp.put_f32_le(self.aux2);
16383 __tmp.put_f32_le(self.aux3);
16384 __tmp.put_f32_le(self.aux4);
16385 __tmp.put_u8(self.mode as u8);
16386 __tmp.put_u8(self.nav_mode);
16387 if matches!(version, MavlinkVersion::V2) {
16388 let len = __tmp.len();
16389 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16390 } else {
16391 __tmp.len()
16392 }
16393 }
16394}
16395#[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
16396#[doc = ""]
16397#[doc = "ID: 113"]
16398#[derive(Debug, Clone, PartialEq)]
16399#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16400#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16401#[cfg_attr(feature = "ts", derive(TS))]
16402#[cfg_attr(feature = "ts", ts(export))]
16403pub struct HIL_GPS_DATA {
16404 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16405 pub time_usec: u64,
16406 #[doc = "Latitude (WGS84)"]
16407 pub lat: i32,
16408 #[doc = "Longitude (WGS84)"]
16409 pub lon: i32,
16410 #[doc = "Altitude (MSL). Positive for up."]
16411 pub alt: i32,
16412 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
16413 pub eph: u16,
16414 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
16415 pub epv: u16,
16416 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
16417 pub vel: u16,
16418 #[doc = "GPS velocity in north direction in earth-fixed NED frame"]
16419 pub vn: i16,
16420 #[doc = "GPS velocity in east direction in earth-fixed NED frame"]
16421 pub ve: i16,
16422 #[doc = "GPS velocity in down direction in earth-fixed NED frame"]
16423 pub vd: i16,
16424 #[doc = "Course over ground (NOT heading, but direction of movement), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
16425 pub cog: u16,
16426 #[doc = "0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix."]
16427 pub fix_type: u8,
16428 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
16429 pub satellites_visible: u8,
16430 #[doc = "GPS ID (zero indexed). Used for multiple GPS inputs"]
16431 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16432 pub id: u8,
16433 #[doc = "Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north"]
16434 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16435 pub yaw: u16,
16436}
16437impl HIL_GPS_DATA {
16438 pub const ENCODED_LEN: usize = 39usize;
16439 pub const DEFAULT: Self = Self {
16440 time_usec: 0_u64,
16441 lat: 0_i32,
16442 lon: 0_i32,
16443 alt: 0_i32,
16444 eph: 0_u16,
16445 epv: 0_u16,
16446 vel: 0_u16,
16447 vn: 0_i16,
16448 ve: 0_i16,
16449 vd: 0_i16,
16450 cog: 0_u16,
16451 fix_type: 0_u8,
16452 satellites_visible: 0_u8,
16453 id: 0_u8,
16454 yaw: 0_u16,
16455 };
16456 #[cfg(feature = "arbitrary")]
16457 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16458 use arbitrary::{Arbitrary, Unstructured};
16459 let mut buf = [0u8; 1024];
16460 rng.fill_bytes(&mut buf);
16461 let mut unstructured = Unstructured::new(&buf);
16462 Self::arbitrary(&mut unstructured).unwrap_or_default()
16463 }
16464}
16465impl Default for HIL_GPS_DATA {
16466 fn default() -> Self {
16467 Self::DEFAULT.clone()
16468 }
16469}
16470impl MessageData for HIL_GPS_DATA {
16471 type Message = MavMessage;
16472 const ID: u32 = 113u32;
16473 const NAME: &'static str = "HIL_GPS";
16474 const EXTRA_CRC: u8 = 124u8;
16475 const ENCODED_LEN: usize = 39usize;
16476 fn deser(
16477 _version: MavlinkVersion,
16478 __input: &[u8],
16479 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16480 let avail_len = __input.len();
16481 let mut payload_buf = [0; Self::ENCODED_LEN];
16482 let mut buf = if avail_len < Self::ENCODED_LEN {
16483 payload_buf[0..avail_len].copy_from_slice(__input);
16484 Bytes::new(&payload_buf)
16485 } else {
16486 Bytes::new(__input)
16487 };
16488 let mut __struct = Self::default();
16489 __struct.time_usec = buf.get_u64_le();
16490 __struct.lat = buf.get_i32_le();
16491 __struct.lon = buf.get_i32_le();
16492 __struct.alt = buf.get_i32_le();
16493 __struct.eph = buf.get_u16_le();
16494 __struct.epv = buf.get_u16_le();
16495 __struct.vel = buf.get_u16_le();
16496 __struct.vn = buf.get_i16_le();
16497 __struct.ve = buf.get_i16_le();
16498 __struct.vd = buf.get_i16_le();
16499 __struct.cog = buf.get_u16_le();
16500 __struct.fix_type = buf.get_u8();
16501 __struct.satellites_visible = buf.get_u8();
16502 __struct.id = buf.get_u8();
16503 __struct.yaw = buf.get_u16_le();
16504 Ok(__struct)
16505 }
16506 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16507 let mut __tmp = BytesMut::new(bytes);
16508 #[allow(clippy::absurd_extreme_comparisons)]
16509 #[allow(unused_comparisons)]
16510 if __tmp.remaining() < Self::ENCODED_LEN {
16511 panic!(
16512 "buffer is too small (need {} bytes, but got {})",
16513 Self::ENCODED_LEN,
16514 __tmp.remaining(),
16515 )
16516 }
16517 __tmp.put_u64_le(self.time_usec);
16518 __tmp.put_i32_le(self.lat);
16519 __tmp.put_i32_le(self.lon);
16520 __tmp.put_i32_le(self.alt);
16521 __tmp.put_u16_le(self.eph);
16522 __tmp.put_u16_le(self.epv);
16523 __tmp.put_u16_le(self.vel);
16524 __tmp.put_i16_le(self.vn);
16525 __tmp.put_i16_le(self.ve);
16526 __tmp.put_i16_le(self.vd);
16527 __tmp.put_u16_le(self.cog);
16528 __tmp.put_u8(self.fix_type);
16529 __tmp.put_u8(self.satellites_visible);
16530 if matches!(version, MavlinkVersion::V2) {
16531 __tmp.put_u8(self.id);
16532 __tmp.put_u16_le(self.yaw);
16533 let len = __tmp.len();
16534 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16535 } else {
16536 __tmp.len()
16537 }
16538 }
16539}
16540#[doc = "Simulated optical flow from a flow sensor (e.g. PX4FLOW or optical mouse sensor)."]
16541#[doc = ""]
16542#[doc = "ID: 114"]
16543#[derive(Debug, Clone, PartialEq)]
16544#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16545#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16546#[cfg_attr(feature = "ts", derive(TS))]
16547#[cfg_attr(feature = "ts", ts(export))]
16548pub struct HIL_OPTICAL_FLOW_DATA {
16549 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16550 pub time_usec: u64,
16551 #[doc = "Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the."]
16552 pub integration_time_us: u32,
16553 #[doc = "Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)"]
16554 pub integrated_x: f32,
16555 #[doc = "Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)"]
16556 pub integrated_y: f32,
16557 #[doc = "RH rotation around X axis"]
16558 pub integrated_xgyro: f32,
16559 #[doc = "RH rotation around Y axis"]
16560 pub integrated_ygyro: f32,
16561 #[doc = "RH rotation around Z axis"]
16562 pub integrated_zgyro: f32,
16563 #[doc = "Time since the distance was sampled."]
16564 pub time_delta_distance_us: u32,
16565 #[doc = "Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance."]
16566 pub distance: f32,
16567 #[doc = "Temperature"]
16568 pub temperature: i16,
16569 #[doc = "Sensor ID"]
16570 pub sensor_id: u8,
16571 #[doc = "Optical flow quality / confidence. 0: no valid flow, 255: maximum quality"]
16572 pub quality: u8,
16573}
16574impl HIL_OPTICAL_FLOW_DATA {
16575 pub const ENCODED_LEN: usize = 44usize;
16576 pub const DEFAULT: Self = Self {
16577 time_usec: 0_u64,
16578 integration_time_us: 0_u32,
16579 integrated_x: 0.0_f32,
16580 integrated_y: 0.0_f32,
16581 integrated_xgyro: 0.0_f32,
16582 integrated_ygyro: 0.0_f32,
16583 integrated_zgyro: 0.0_f32,
16584 time_delta_distance_us: 0_u32,
16585 distance: 0.0_f32,
16586 temperature: 0_i16,
16587 sensor_id: 0_u8,
16588 quality: 0_u8,
16589 };
16590 #[cfg(feature = "arbitrary")]
16591 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16592 use arbitrary::{Arbitrary, Unstructured};
16593 let mut buf = [0u8; 1024];
16594 rng.fill_bytes(&mut buf);
16595 let mut unstructured = Unstructured::new(&buf);
16596 Self::arbitrary(&mut unstructured).unwrap_or_default()
16597 }
16598}
16599impl Default for HIL_OPTICAL_FLOW_DATA {
16600 fn default() -> Self {
16601 Self::DEFAULT.clone()
16602 }
16603}
16604impl MessageData for HIL_OPTICAL_FLOW_DATA {
16605 type Message = MavMessage;
16606 const ID: u32 = 114u32;
16607 const NAME: &'static str = "HIL_OPTICAL_FLOW";
16608 const EXTRA_CRC: u8 = 237u8;
16609 const ENCODED_LEN: usize = 44usize;
16610 fn deser(
16611 _version: MavlinkVersion,
16612 __input: &[u8],
16613 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16614 let avail_len = __input.len();
16615 let mut payload_buf = [0; Self::ENCODED_LEN];
16616 let mut buf = if avail_len < Self::ENCODED_LEN {
16617 payload_buf[0..avail_len].copy_from_slice(__input);
16618 Bytes::new(&payload_buf)
16619 } else {
16620 Bytes::new(__input)
16621 };
16622 let mut __struct = Self::default();
16623 __struct.time_usec = buf.get_u64_le();
16624 __struct.integration_time_us = buf.get_u32_le();
16625 __struct.integrated_x = buf.get_f32_le();
16626 __struct.integrated_y = buf.get_f32_le();
16627 __struct.integrated_xgyro = buf.get_f32_le();
16628 __struct.integrated_ygyro = buf.get_f32_le();
16629 __struct.integrated_zgyro = buf.get_f32_le();
16630 __struct.time_delta_distance_us = buf.get_u32_le();
16631 __struct.distance = buf.get_f32_le();
16632 __struct.temperature = buf.get_i16_le();
16633 __struct.sensor_id = buf.get_u8();
16634 __struct.quality = buf.get_u8();
16635 Ok(__struct)
16636 }
16637 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16638 let mut __tmp = BytesMut::new(bytes);
16639 #[allow(clippy::absurd_extreme_comparisons)]
16640 #[allow(unused_comparisons)]
16641 if __tmp.remaining() < Self::ENCODED_LEN {
16642 panic!(
16643 "buffer is too small (need {} bytes, but got {})",
16644 Self::ENCODED_LEN,
16645 __tmp.remaining(),
16646 )
16647 }
16648 __tmp.put_u64_le(self.time_usec);
16649 __tmp.put_u32_le(self.integration_time_us);
16650 __tmp.put_f32_le(self.integrated_x);
16651 __tmp.put_f32_le(self.integrated_y);
16652 __tmp.put_f32_le(self.integrated_xgyro);
16653 __tmp.put_f32_le(self.integrated_ygyro);
16654 __tmp.put_f32_le(self.integrated_zgyro);
16655 __tmp.put_u32_le(self.time_delta_distance_us);
16656 __tmp.put_f32_le(self.distance);
16657 __tmp.put_i16_le(self.temperature);
16658 __tmp.put_u8(self.sensor_id);
16659 __tmp.put_u8(self.quality);
16660 if matches!(version, MavlinkVersion::V2) {
16661 let len = __tmp.len();
16662 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16663 } else {
16664 __tmp.len()
16665 }
16666 }
16667}
16668#[doc = "Sent from simulation to autopilot. The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification."]
16669#[doc = ""]
16670#[doc = "ID: 92"]
16671#[derive(Debug, Clone, PartialEq)]
16672#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16673#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16674#[cfg_attr(feature = "ts", derive(TS))]
16675#[cfg_attr(feature = "ts", ts(export))]
16676pub struct HIL_RC_INPUTS_RAW_DATA {
16677 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16678 pub time_usec: u64,
16679 #[doc = "RC channel 1 value"]
16680 pub chan1_raw: u16,
16681 #[doc = "RC channel 2 value"]
16682 pub chan2_raw: u16,
16683 #[doc = "RC channel 3 value"]
16684 pub chan3_raw: u16,
16685 #[doc = "RC channel 4 value"]
16686 pub chan4_raw: u16,
16687 #[doc = "RC channel 5 value"]
16688 pub chan5_raw: u16,
16689 #[doc = "RC channel 6 value"]
16690 pub chan6_raw: u16,
16691 #[doc = "RC channel 7 value"]
16692 pub chan7_raw: u16,
16693 #[doc = "RC channel 8 value"]
16694 pub chan8_raw: u16,
16695 #[doc = "RC channel 9 value"]
16696 pub chan9_raw: u16,
16697 #[doc = "RC channel 10 value"]
16698 pub chan10_raw: u16,
16699 #[doc = "RC channel 11 value"]
16700 pub chan11_raw: u16,
16701 #[doc = "RC channel 12 value"]
16702 pub chan12_raw: u16,
16703 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
16704 pub rssi: u8,
16705}
16706impl HIL_RC_INPUTS_RAW_DATA {
16707 pub const ENCODED_LEN: usize = 33usize;
16708 pub const DEFAULT: Self = Self {
16709 time_usec: 0_u64,
16710 chan1_raw: 0_u16,
16711 chan2_raw: 0_u16,
16712 chan3_raw: 0_u16,
16713 chan4_raw: 0_u16,
16714 chan5_raw: 0_u16,
16715 chan6_raw: 0_u16,
16716 chan7_raw: 0_u16,
16717 chan8_raw: 0_u16,
16718 chan9_raw: 0_u16,
16719 chan10_raw: 0_u16,
16720 chan11_raw: 0_u16,
16721 chan12_raw: 0_u16,
16722 rssi: 0_u8,
16723 };
16724 #[cfg(feature = "arbitrary")]
16725 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16726 use arbitrary::{Arbitrary, Unstructured};
16727 let mut buf = [0u8; 1024];
16728 rng.fill_bytes(&mut buf);
16729 let mut unstructured = Unstructured::new(&buf);
16730 Self::arbitrary(&mut unstructured).unwrap_or_default()
16731 }
16732}
16733impl Default for HIL_RC_INPUTS_RAW_DATA {
16734 fn default() -> Self {
16735 Self::DEFAULT.clone()
16736 }
16737}
16738impl MessageData for HIL_RC_INPUTS_RAW_DATA {
16739 type Message = MavMessage;
16740 const ID: u32 = 92u32;
16741 const NAME: &'static str = "HIL_RC_INPUTS_RAW";
16742 const EXTRA_CRC: u8 = 54u8;
16743 const ENCODED_LEN: usize = 33usize;
16744 fn deser(
16745 _version: MavlinkVersion,
16746 __input: &[u8],
16747 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16748 let avail_len = __input.len();
16749 let mut payload_buf = [0; Self::ENCODED_LEN];
16750 let mut buf = if avail_len < Self::ENCODED_LEN {
16751 payload_buf[0..avail_len].copy_from_slice(__input);
16752 Bytes::new(&payload_buf)
16753 } else {
16754 Bytes::new(__input)
16755 };
16756 let mut __struct = Self::default();
16757 __struct.time_usec = buf.get_u64_le();
16758 __struct.chan1_raw = buf.get_u16_le();
16759 __struct.chan2_raw = buf.get_u16_le();
16760 __struct.chan3_raw = buf.get_u16_le();
16761 __struct.chan4_raw = buf.get_u16_le();
16762 __struct.chan5_raw = buf.get_u16_le();
16763 __struct.chan6_raw = buf.get_u16_le();
16764 __struct.chan7_raw = buf.get_u16_le();
16765 __struct.chan8_raw = buf.get_u16_le();
16766 __struct.chan9_raw = buf.get_u16_le();
16767 __struct.chan10_raw = buf.get_u16_le();
16768 __struct.chan11_raw = buf.get_u16_le();
16769 __struct.chan12_raw = buf.get_u16_le();
16770 __struct.rssi = buf.get_u8();
16771 Ok(__struct)
16772 }
16773 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16774 let mut __tmp = BytesMut::new(bytes);
16775 #[allow(clippy::absurd_extreme_comparisons)]
16776 #[allow(unused_comparisons)]
16777 if __tmp.remaining() < Self::ENCODED_LEN {
16778 panic!(
16779 "buffer is too small (need {} bytes, but got {})",
16780 Self::ENCODED_LEN,
16781 __tmp.remaining(),
16782 )
16783 }
16784 __tmp.put_u64_le(self.time_usec);
16785 __tmp.put_u16_le(self.chan1_raw);
16786 __tmp.put_u16_le(self.chan2_raw);
16787 __tmp.put_u16_le(self.chan3_raw);
16788 __tmp.put_u16_le(self.chan4_raw);
16789 __tmp.put_u16_le(self.chan5_raw);
16790 __tmp.put_u16_le(self.chan6_raw);
16791 __tmp.put_u16_le(self.chan7_raw);
16792 __tmp.put_u16_le(self.chan8_raw);
16793 __tmp.put_u16_le(self.chan9_raw);
16794 __tmp.put_u16_le(self.chan10_raw);
16795 __tmp.put_u16_le(self.chan11_raw);
16796 __tmp.put_u16_le(self.chan12_raw);
16797 __tmp.put_u8(self.rssi);
16798 if matches!(version, MavlinkVersion::V2) {
16799 let len = __tmp.len();
16800 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16801 } else {
16802 __tmp.len()
16803 }
16804 }
16805}
16806#[doc = "The IMU readings in SI units in NED body frame."]
16807#[doc = ""]
16808#[doc = "ID: 107"]
16809#[derive(Debug, Clone, PartialEq)]
16810#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16811#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16812#[cfg_attr(feature = "ts", derive(TS))]
16813#[cfg_attr(feature = "ts", ts(export))]
16814pub struct HIL_SENSOR_DATA {
16815 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16816 pub time_usec: u64,
16817 #[doc = "X acceleration"]
16818 pub xacc: f32,
16819 #[doc = "Y acceleration"]
16820 pub yacc: f32,
16821 #[doc = "Z acceleration"]
16822 pub zacc: f32,
16823 #[doc = "Angular speed around X axis in body frame"]
16824 pub xgyro: f32,
16825 #[doc = "Angular speed around Y axis in body frame"]
16826 pub ygyro: f32,
16827 #[doc = "Angular speed around Z axis in body frame"]
16828 pub zgyro: f32,
16829 #[doc = "X Magnetic field"]
16830 pub xmag: f32,
16831 #[doc = "Y Magnetic field"]
16832 pub ymag: f32,
16833 #[doc = "Z Magnetic field"]
16834 pub zmag: f32,
16835 #[doc = "Absolute pressure"]
16836 pub abs_pressure: f32,
16837 #[doc = "Differential pressure (airspeed)"]
16838 pub diff_pressure: f32,
16839 #[doc = "Altitude calculated from pressure"]
16840 pub pressure_alt: f32,
16841 #[doc = "Temperature"]
16842 pub temperature: f32,
16843 #[doc = "Bitmap for fields that have updated since last message"]
16844 pub fields_updated: HilSensorUpdatedFlags,
16845 #[doc = "Sensor ID (zero indexed). Used for multiple sensor inputs"]
16846 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16847 pub id: u8,
16848}
16849impl HIL_SENSOR_DATA {
16850 pub const ENCODED_LEN: usize = 65usize;
16851 pub const DEFAULT: Self = Self {
16852 time_usec: 0_u64,
16853 xacc: 0.0_f32,
16854 yacc: 0.0_f32,
16855 zacc: 0.0_f32,
16856 xgyro: 0.0_f32,
16857 ygyro: 0.0_f32,
16858 zgyro: 0.0_f32,
16859 xmag: 0.0_f32,
16860 ymag: 0.0_f32,
16861 zmag: 0.0_f32,
16862 abs_pressure: 0.0_f32,
16863 diff_pressure: 0.0_f32,
16864 pressure_alt: 0.0_f32,
16865 temperature: 0.0_f32,
16866 fields_updated: HilSensorUpdatedFlags::DEFAULT,
16867 id: 0_u8,
16868 };
16869 #[cfg(feature = "arbitrary")]
16870 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16871 use arbitrary::{Arbitrary, Unstructured};
16872 let mut buf = [0u8; 1024];
16873 rng.fill_bytes(&mut buf);
16874 let mut unstructured = Unstructured::new(&buf);
16875 Self::arbitrary(&mut unstructured).unwrap_or_default()
16876 }
16877}
16878impl Default for HIL_SENSOR_DATA {
16879 fn default() -> Self {
16880 Self::DEFAULT.clone()
16881 }
16882}
16883impl MessageData for HIL_SENSOR_DATA {
16884 type Message = MavMessage;
16885 const ID: u32 = 107u32;
16886 const NAME: &'static str = "HIL_SENSOR";
16887 const EXTRA_CRC: u8 = 108u8;
16888 const ENCODED_LEN: usize = 65usize;
16889 fn deser(
16890 _version: MavlinkVersion,
16891 __input: &[u8],
16892 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16893 let avail_len = __input.len();
16894 let mut payload_buf = [0; Self::ENCODED_LEN];
16895 let mut buf = if avail_len < Self::ENCODED_LEN {
16896 payload_buf[0..avail_len].copy_from_slice(__input);
16897 Bytes::new(&payload_buf)
16898 } else {
16899 Bytes::new(__input)
16900 };
16901 let mut __struct = Self::default();
16902 __struct.time_usec = buf.get_u64_le();
16903 __struct.xacc = buf.get_f32_le();
16904 __struct.yacc = buf.get_f32_le();
16905 __struct.zacc = buf.get_f32_le();
16906 __struct.xgyro = buf.get_f32_le();
16907 __struct.ygyro = buf.get_f32_le();
16908 __struct.zgyro = buf.get_f32_le();
16909 __struct.xmag = buf.get_f32_le();
16910 __struct.ymag = buf.get_f32_le();
16911 __struct.zmag = buf.get_f32_le();
16912 __struct.abs_pressure = buf.get_f32_le();
16913 __struct.diff_pressure = buf.get_f32_le();
16914 __struct.pressure_alt = buf.get_f32_le();
16915 __struct.temperature = buf.get_f32_le();
16916 let tmp = buf.get_u32_le();
16917 __struct.fields_updated = HilSensorUpdatedFlags::from_bits(
16918 tmp & HilSensorUpdatedFlags::all().bits(),
16919 )
16920 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
16921 flag_type: "HilSensorUpdatedFlags",
16922 value: tmp as u32,
16923 })?;
16924 __struct.id = buf.get_u8();
16925 Ok(__struct)
16926 }
16927 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16928 let mut __tmp = BytesMut::new(bytes);
16929 #[allow(clippy::absurd_extreme_comparisons)]
16930 #[allow(unused_comparisons)]
16931 if __tmp.remaining() < Self::ENCODED_LEN {
16932 panic!(
16933 "buffer is too small (need {} bytes, but got {})",
16934 Self::ENCODED_LEN,
16935 __tmp.remaining(),
16936 )
16937 }
16938 __tmp.put_u64_le(self.time_usec);
16939 __tmp.put_f32_le(self.xacc);
16940 __tmp.put_f32_le(self.yacc);
16941 __tmp.put_f32_le(self.zacc);
16942 __tmp.put_f32_le(self.xgyro);
16943 __tmp.put_f32_le(self.ygyro);
16944 __tmp.put_f32_le(self.zgyro);
16945 __tmp.put_f32_le(self.xmag);
16946 __tmp.put_f32_le(self.ymag);
16947 __tmp.put_f32_le(self.zmag);
16948 __tmp.put_f32_le(self.abs_pressure);
16949 __tmp.put_f32_le(self.diff_pressure);
16950 __tmp.put_f32_le(self.pressure_alt);
16951 __tmp.put_f32_le(self.temperature);
16952 __tmp.put_u32_le(self.fields_updated.bits());
16953 if matches!(version, MavlinkVersion::V2) {
16954 __tmp.put_u8(self.id);
16955 let len = __tmp.len();
16956 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16957 } else {
16958 __tmp.len()
16959 }
16960 }
16961}
16962#[deprecated = "Suffers from missing airspeed fields and singularities due to Euler angles. See `HIL_STATE_QUATERNION` (Deprecated since 2013-07)"]
16963#[doc = "Sent from simulation to autopilot. This packet is useful for high throughput applications such as hardware in the loop simulations."]
16964#[doc = ""]
16965#[doc = "ID: 90"]
16966#[derive(Debug, Clone, PartialEq)]
16967#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16968#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16969#[cfg_attr(feature = "ts", derive(TS))]
16970#[cfg_attr(feature = "ts", ts(export))]
16971pub struct HIL_STATE_DATA {
16972 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16973 pub time_usec: u64,
16974 #[doc = "Roll angle"]
16975 pub roll: f32,
16976 #[doc = "Pitch angle"]
16977 pub pitch: f32,
16978 #[doc = "Yaw angle"]
16979 pub yaw: f32,
16980 #[doc = "Body frame roll / phi angular speed"]
16981 pub rollspeed: f32,
16982 #[doc = "Body frame pitch / theta angular speed"]
16983 pub pitchspeed: f32,
16984 #[doc = "Body frame yaw / psi angular speed"]
16985 pub yawspeed: f32,
16986 #[doc = "Latitude"]
16987 pub lat: i32,
16988 #[doc = "Longitude"]
16989 pub lon: i32,
16990 #[doc = "Altitude"]
16991 pub alt: i32,
16992 #[doc = "Ground X Speed (Latitude)"]
16993 pub vx: i16,
16994 #[doc = "Ground Y Speed (Longitude)"]
16995 pub vy: i16,
16996 #[doc = "Ground Z Speed (Altitude)"]
16997 pub vz: i16,
16998 #[doc = "X acceleration"]
16999 pub xacc: i16,
17000 #[doc = "Y acceleration"]
17001 pub yacc: i16,
17002 #[doc = "Z acceleration"]
17003 pub zacc: i16,
17004}
17005impl HIL_STATE_DATA {
17006 pub const ENCODED_LEN: usize = 56usize;
17007 pub const DEFAULT: Self = Self {
17008 time_usec: 0_u64,
17009 roll: 0.0_f32,
17010 pitch: 0.0_f32,
17011 yaw: 0.0_f32,
17012 rollspeed: 0.0_f32,
17013 pitchspeed: 0.0_f32,
17014 yawspeed: 0.0_f32,
17015 lat: 0_i32,
17016 lon: 0_i32,
17017 alt: 0_i32,
17018 vx: 0_i16,
17019 vy: 0_i16,
17020 vz: 0_i16,
17021 xacc: 0_i16,
17022 yacc: 0_i16,
17023 zacc: 0_i16,
17024 };
17025 #[cfg(feature = "arbitrary")]
17026 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17027 use arbitrary::{Arbitrary, Unstructured};
17028 let mut buf = [0u8; 1024];
17029 rng.fill_bytes(&mut buf);
17030 let mut unstructured = Unstructured::new(&buf);
17031 Self::arbitrary(&mut unstructured).unwrap_or_default()
17032 }
17033}
17034impl Default for HIL_STATE_DATA {
17035 fn default() -> Self {
17036 Self::DEFAULT.clone()
17037 }
17038}
17039impl MessageData for HIL_STATE_DATA {
17040 type Message = MavMessage;
17041 const ID: u32 = 90u32;
17042 const NAME: &'static str = "HIL_STATE";
17043 const EXTRA_CRC: u8 = 183u8;
17044 const ENCODED_LEN: usize = 56usize;
17045 fn deser(
17046 _version: MavlinkVersion,
17047 __input: &[u8],
17048 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17049 let avail_len = __input.len();
17050 let mut payload_buf = [0; Self::ENCODED_LEN];
17051 let mut buf = if avail_len < Self::ENCODED_LEN {
17052 payload_buf[0..avail_len].copy_from_slice(__input);
17053 Bytes::new(&payload_buf)
17054 } else {
17055 Bytes::new(__input)
17056 };
17057 let mut __struct = Self::default();
17058 __struct.time_usec = buf.get_u64_le();
17059 __struct.roll = buf.get_f32_le();
17060 __struct.pitch = buf.get_f32_le();
17061 __struct.yaw = buf.get_f32_le();
17062 __struct.rollspeed = buf.get_f32_le();
17063 __struct.pitchspeed = buf.get_f32_le();
17064 __struct.yawspeed = buf.get_f32_le();
17065 __struct.lat = buf.get_i32_le();
17066 __struct.lon = buf.get_i32_le();
17067 __struct.alt = buf.get_i32_le();
17068 __struct.vx = buf.get_i16_le();
17069 __struct.vy = buf.get_i16_le();
17070 __struct.vz = buf.get_i16_le();
17071 __struct.xacc = buf.get_i16_le();
17072 __struct.yacc = buf.get_i16_le();
17073 __struct.zacc = buf.get_i16_le();
17074 Ok(__struct)
17075 }
17076 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17077 let mut __tmp = BytesMut::new(bytes);
17078 #[allow(clippy::absurd_extreme_comparisons)]
17079 #[allow(unused_comparisons)]
17080 if __tmp.remaining() < Self::ENCODED_LEN {
17081 panic!(
17082 "buffer is too small (need {} bytes, but got {})",
17083 Self::ENCODED_LEN,
17084 __tmp.remaining(),
17085 )
17086 }
17087 __tmp.put_u64_le(self.time_usec);
17088 __tmp.put_f32_le(self.roll);
17089 __tmp.put_f32_le(self.pitch);
17090 __tmp.put_f32_le(self.yaw);
17091 __tmp.put_f32_le(self.rollspeed);
17092 __tmp.put_f32_le(self.pitchspeed);
17093 __tmp.put_f32_le(self.yawspeed);
17094 __tmp.put_i32_le(self.lat);
17095 __tmp.put_i32_le(self.lon);
17096 __tmp.put_i32_le(self.alt);
17097 __tmp.put_i16_le(self.vx);
17098 __tmp.put_i16_le(self.vy);
17099 __tmp.put_i16_le(self.vz);
17100 __tmp.put_i16_le(self.xacc);
17101 __tmp.put_i16_le(self.yacc);
17102 __tmp.put_i16_le(self.zacc);
17103 if matches!(version, MavlinkVersion::V2) {
17104 let len = __tmp.len();
17105 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17106 } else {
17107 __tmp.len()
17108 }
17109 }
17110}
17111#[doc = "Sent from simulation to autopilot, avoids in contrast to HIL_STATE singularities. This packet is useful for high throughput applications such as hardware in the loop simulations."]
17112#[doc = ""]
17113#[doc = "ID: 115"]
17114#[derive(Debug, Clone, PartialEq)]
17115#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17116#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17117#[cfg_attr(feature = "ts", derive(TS))]
17118#[cfg_attr(feature = "ts", ts(export))]
17119pub struct HIL_STATE_QUATERNION_DATA {
17120 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17121 pub time_usec: u64,
17122 #[doc = "Vehicle attitude expressed as normalized quaternion in w, x, y, z order (with 1 0 0 0 being the null-rotation)"]
17123 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17124 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
17125 pub attitude_quaternion: [f32; 4],
17126 #[doc = "Body frame roll / phi angular speed"]
17127 pub rollspeed: f32,
17128 #[doc = "Body frame pitch / theta angular speed"]
17129 pub pitchspeed: f32,
17130 #[doc = "Body frame yaw / psi angular speed"]
17131 pub yawspeed: f32,
17132 #[doc = "Latitude"]
17133 pub lat: i32,
17134 #[doc = "Longitude"]
17135 pub lon: i32,
17136 #[doc = "Altitude"]
17137 pub alt: i32,
17138 #[doc = "Ground X Speed (Latitude)"]
17139 pub vx: i16,
17140 #[doc = "Ground Y Speed (Longitude)"]
17141 pub vy: i16,
17142 #[doc = "Ground Z Speed (Altitude)"]
17143 pub vz: i16,
17144 #[doc = "Indicated airspeed"]
17145 pub ind_airspeed: u16,
17146 #[doc = "True airspeed"]
17147 pub true_airspeed: u16,
17148 #[doc = "X acceleration"]
17149 pub xacc: i16,
17150 #[doc = "Y acceleration"]
17151 pub yacc: i16,
17152 #[doc = "Z acceleration"]
17153 pub zacc: i16,
17154}
17155impl HIL_STATE_QUATERNION_DATA {
17156 pub const ENCODED_LEN: usize = 64usize;
17157 pub const DEFAULT: Self = Self {
17158 time_usec: 0_u64,
17159 attitude_quaternion: [0.0_f32; 4usize],
17160 rollspeed: 0.0_f32,
17161 pitchspeed: 0.0_f32,
17162 yawspeed: 0.0_f32,
17163 lat: 0_i32,
17164 lon: 0_i32,
17165 alt: 0_i32,
17166 vx: 0_i16,
17167 vy: 0_i16,
17168 vz: 0_i16,
17169 ind_airspeed: 0_u16,
17170 true_airspeed: 0_u16,
17171 xacc: 0_i16,
17172 yacc: 0_i16,
17173 zacc: 0_i16,
17174 };
17175 #[cfg(feature = "arbitrary")]
17176 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17177 use arbitrary::{Arbitrary, Unstructured};
17178 let mut buf = [0u8; 1024];
17179 rng.fill_bytes(&mut buf);
17180 let mut unstructured = Unstructured::new(&buf);
17181 Self::arbitrary(&mut unstructured).unwrap_or_default()
17182 }
17183}
17184impl Default for HIL_STATE_QUATERNION_DATA {
17185 fn default() -> Self {
17186 Self::DEFAULT.clone()
17187 }
17188}
17189impl MessageData for HIL_STATE_QUATERNION_DATA {
17190 type Message = MavMessage;
17191 const ID: u32 = 115u32;
17192 const NAME: &'static str = "HIL_STATE_QUATERNION";
17193 const EXTRA_CRC: u8 = 4u8;
17194 const ENCODED_LEN: usize = 64usize;
17195 fn deser(
17196 _version: MavlinkVersion,
17197 __input: &[u8],
17198 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17199 let avail_len = __input.len();
17200 let mut payload_buf = [0; Self::ENCODED_LEN];
17201 let mut buf = if avail_len < Self::ENCODED_LEN {
17202 payload_buf[0..avail_len].copy_from_slice(__input);
17203 Bytes::new(&payload_buf)
17204 } else {
17205 Bytes::new(__input)
17206 };
17207 let mut __struct = Self::default();
17208 __struct.time_usec = buf.get_u64_le();
17209 for v in &mut __struct.attitude_quaternion {
17210 let val = buf.get_f32_le();
17211 *v = val;
17212 }
17213 __struct.rollspeed = buf.get_f32_le();
17214 __struct.pitchspeed = buf.get_f32_le();
17215 __struct.yawspeed = buf.get_f32_le();
17216 __struct.lat = buf.get_i32_le();
17217 __struct.lon = buf.get_i32_le();
17218 __struct.alt = buf.get_i32_le();
17219 __struct.vx = buf.get_i16_le();
17220 __struct.vy = buf.get_i16_le();
17221 __struct.vz = buf.get_i16_le();
17222 __struct.ind_airspeed = buf.get_u16_le();
17223 __struct.true_airspeed = buf.get_u16_le();
17224 __struct.xacc = buf.get_i16_le();
17225 __struct.yacc = buf.get_i16_le();
17226 __struct.zacc = buf.get_i16_le();
17227 Ok(__struct)
17228 }
17229 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17230 let mut __tmp = BytesMut::new(bytes);
17231 #[allow(clippy::absurd_extreme_comparisons)]
17232 #[allow(unused_comparisons)]
17233 if __tmp.remaining() < Self::ENCODED_LEN {
17234 panic!(
17235 "buffer is too small (need {} bytes, but got {})",
17236 Self::ENCODED_LEN,
17237 __tmp.remaining(),
17238 )
17239 }
17240 __tmp.put_u64_le(self.time_usec);
17241 for val in &self.attitude_quaternion {
17242 __tmp.put_f32_le(*val);
17243 }
17244 __tmp.put_f32_le(self.rollspeed);
17245 __tmp.put_f32_le(self.pitchspeed);
17246 __tmp.put_f32_le(self.yawspeed);
17247 __tmp.put_i32_le(self.lat);
17248 __tmp.put_i32_le(self.lon);
17249 __tmp.put_i32_le(self.alt);
17250 __tmp.put_i16_le(self.vx);
17251 __tmp.put_i16_le(self.vy);
17252 __tmp.put_i16_le(self.vz);
17253 __tmp.put_u16_le(self.ind_airspeed);
17254 __tmp.put_u16_le(self.true_airspeed);
17255 __tmp.put_i16_le(self.xacc);
17256 __tmp.put_i16_le(self.yacc);
17257 __tmp.put_i16_le(self.zacc);
17258 if matches!(version, MavlinkVersion::V2) {
17259 let len = __tmp.len();
17260 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17261 } else {
17262 __tmp.len()
17263 }
17264 }
17265}
17266#[doc = "Contains the home position. \tThe home position is the default position that the system will return to and land on. \tThe position must be set automatically by the system during the takeoff, and may also be explicitly set using MAV_CMD_DO_SET_HOME. \tThe global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. \tUnder normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. \tThe approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: this message can be requested by sending the MAV_CMD_REQUEST_MESSAGE with param1=242 (or the deprecated MAV_CMD_GET_HOME_POSITION command)."]
17267#[doc = ""]
17268#[doc = "ID: 242"]
17269#[derive(Debug, Clone, PartialEq)]
17270#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17271#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17272#[cfg_attr(feature = "ts", derive(TS))]
17273#[cfg_attr(feature = "ts", ts(export))]
17274pub struct HOME_POSITION_DATA {
17275 #[doc = "Latitude (WGS84)"]
17276 pub latitude: i32,
17277 #[doc = "Longitude (WGS84)"]
17278 pub longitude: i32,
17279 #[doc = "Altitude (MSL). Positive for up."]
17280 pub altitude: i32,
17281 #[doc = "Local X position of this position in the local coordinate frame (NED)"]
17282 pub x: f32,
17283 #[doc = "Local Y position of this position in the local coordinate frame (NED)"]
17284 pub y: f32,
17285 #[doc = "Local Z position of this position in the local coordinate frame (NED: positive \"down\")"]
17286 pub z: f32,
17287 #[doc = "Quaternion indicating world-to-surface-normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground. All fields should be set to NaN if an accurate quaternion for both heading and surface slope cannot be supplied."]
17288 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17289 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
17290 pub q: [f32; 4],
17291 #[doc = "Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
17292 pub approach_x: f32,
17293 #[doc = "Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
17294 pub approach_y: f32,
17295 #[doc = "Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
17296 pub approach_z: f32,
17297 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17298 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17299 pub time_usec: u64,
17300}
17301impl HOME_POSITION_DATA {
17302 pub const ENCODED_LEN: usize = 60usize;
17303 pub const DEFAULT: Self = Self {
17304 latitude: 0_i32,
17305 longitude: 0_i32,
17306 altitude: 0_i32,
17307 x: 0.0_f32,
17308 y: 0.0_f32,
17309 z: 0.0_f32,
17310 q: [0.0_f32; 4usize],
17311 approach_x: 0.0_f32,
17312 approach_y: 0.0_f32,
17313 approach_z: 0.0_f32,
17314 time_usec: 0_u64,
17315 };
17316 #[cfg(feature = "arbitrary")]
17317 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17318 use arbitrary::{Arbitrary, Unstructured};
17319 let mut buf = [0u8; 1024];
17320 rng.fill_bytes(&mut buf);
17321 let mut unstructured = Unstructured::new(&buf);
17322 Self::arbitrary(&mut unstructured).unwrap_or_default()
17323 }
17324}
17325impl Default for HOME_POSITION_DATA {
17326 fn default() -> Self {
17327 Self::DEFAULT.clone()
17328 }
17329}
17330impl MessageData for HOME_POSITION_DATA {
17331 type Message = MavMessage;
17332 const ID: u32 = 242u32;
17333 const NAME: &'static str = "HOME_POSITION";
17334 const EXTRA_CRC: u8 = 104u8;
17335 const ENCODED_LEN: usize = 60usize;
17336 fn deser(
17337 _version: MavlinkVersion,
17338 __input: &[u8],
17339 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17340 let avail_len = __input.len();
17341 let mut payload_buf = [0; Self::ENCODED_LEN];
17342 let mut buf = if avail_len < Self::ENCODED_LEN {
17343 payload_buf[0..avail_len].copy_from_slice(__input);
17344 Bytes::new(&payload_buf)
17345 } else {
17346 Bytes::new(__input)
17347 };
17348 let mut __struct = Self::default();
17349 __struct.latitude = buf.get_i32_le();
17350 __struct.longitude = buf.get_i32_le();
17351 __struct.altitude = buf.get_i32_le();
17352 __struct.x = buf.get_f32_le();
17353 __struct.y = buf.get_f32_le();
17354 __struct.z = buf.get_f32_le();
17355 for v in &mut __struct.q {
17356 let val = buf.get_f32_le();
17357 *v = val;
17358 }
17359 __struct.approach_x = buf.get_f32_le();
17360 __struct.approach_y = buf.get_f32_le();
17361 __struct.approach_z = buf.get_f32_le();
17362 __struct.time_usec = buf.get_u64_le();
17363 Ok(__struct)
17364 }
17365 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17366 let mut __tmp = BytesMut::new(bytes);
17367 #[allow(clippy::absurd_extreme_comparisons)]
17368 #[allow(unused_comparisons)]
17369 if __tmp.remaining() < Self::ENCODED_LEN {
17370 panic!(
17371 "buffer is too small (need {} bytes, but got {})",
17372 Self::ENCODED_LEN,
17373 __tmp.remaining(),
17374 )
17375 }
17376 __tmp.put_i32_le(self.latitude);
17377 __tmp.put_i32_le(self.longitude);
17378 __tmp.put_i32_le(self.altitude);
17379 __tmp.put_f32_le(self.x);
17380 __tmp.put_f32_le(self.y);
17381 __tmp.put_f32_le(self.z);
17382 for val in &self.q {
17383 __tmp.put_f32_le(*val);
17384 }
17385 __tmp.put_f32_le(self.approach_x);
17386 __tmp.put_f32_le(self.approach_y);
17387 __tmp.put_f32_le(self.approach_z);
17388 if matches!(version, MavlinkVersion::V2) {
17389 __tmp.put_u64_le(self.time_usec);
17390 let len = __tmp.len();
17391 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17392 } else {
17393 __tmp.len()
17394 }
17395 }
17396}
17397#[doc = "Temperature and humidity from hygrometer."]
17398#[doc = ""]
17399#[doc = "ID: 12920"]
17400#[derive(Debug, Clone, PartialEq)]
17401#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17402#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17403#[cfg_attr(feature = "ts", derive(TS))]
17404#[cfg_attr(feature = "ts", ts(export))]
17405pub struct HYGROMETER_SENSOR_DATA {
17406 #[doc = "Temperature"]
17407 pub temperature: i16,
17408 #[doc = "Humidity"]
17409 pub humidity: u16,
17410 #[doc = "Hygrometer ID"]
17411 pub id: u8,
17412}
17413impl HYGROMETER_SENSOR_DATA {
17414 pub const ENCODED_LEN: usize = 5usize;
17415 pub const DEFAULT: Self = Self {
17416 temperature: 0_i16,
17417 humidity: 0_u16,
17418 id: 0_u8,
17419 };
17420 #[cfg(feature = "arbitrary")]
17421 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17422 use arbitrary::{Arbitrary, Unstructured};
17423 let mut buf = [0u8; 1024];
17424 rng.fill_bytes(&mut buf);
17425 let mut unstructured = Unstructured::new(&buf);
17426 Self::arbitrary(&mut unstructured).unwrap_or_default()
17427 }
17428}
17429impl Default for HYGROMETER_SENSOR_DATA {
17430 fn default() -> Self {
17431 Self::DEFAULT.clone()
17432 }
17433}
17434impl MessageData for HYGROMETER_SENSOR_DATA {
17435 type Message = MavMessage;
17436 const ID: u32 = 12920u32;
17437 const NAME: &'static str = "HYGROMETER_SENSOR";
17438 const EXTRA_CRC: u8 = 20u8;
17439 const ENCODED_LEN: usize = 5usize;
17440 fn deser(
17441 _version: MavlinkVersion,
17442 __input: &[u8],
17443 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17444 let avail_len = __input.len();
17445 let mut payload_buf = [0; Self::ENCODED_LEN];
17446 let mut buf = if avail_len < Self::ENCODED_LEN {
17447 payload_buf[0..avail_len].copy_from_slice(__input);
17448 Bytes::new(&payload_buf)
17449 } else {
17450 Bytes::new(__input)
17451 };
17452 let mut __struct = Self::default();
17453 __struct.temperature = buf.get_i16_le();
17454 __struct.humidity = buf.get_u16_le();
17455 __struct.id = buf.get_u8();
17456 Ok(__struct)
17457 }
17458 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17459 let mut __tmp = BytesMut::new(bytes);
17460 #[allow(clippy::absurd_extreme_comparisons)]
17461 #[allow(unused_comparisons)]
17462 if __tmp.remaining() < Self::ENCODED_LEN {
17463 panic!(
17464 "buffer is too small (need {} bytes, but got {})",
17465 Self::ENCODED_LEN,
17466 __tmp.remaining(),
17467 )
17468 }
17469 __tmp.put_i16_le(self.temperature);
17470 __tmp.put_u16_le(self.humidity);
17471 __tmp.put_u8(self.id);
17472 if matches!(version, MavlinkVersion::V2) {
17473 let len = __tmp.len();
17474 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17475 } else {
17476 __tmp.len()
17477 }
17478 }
17479}
17480#[doc = "Illuminator status."]
17481#[doc = ""]
17482#[doc = "ID: 440"]
17483#[derive(Debug, Clone, PartialEq)]
17484#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17485#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17486#[cfg_attr(feature = "ts", derive(TS))]
17487#[cfg_attr(feature = "ts", ts(export))]
17488pub struct ILLUMINATOR_STATUS_DATA {
17489 #[doc = "Time since the start-up of the illuminator in ms"]
17490 pub uptime_ms: u32,
17491 #[doc = "Errors"]
17492 pub error_status: IlluminatorErrorFlags,
17493 #[doc = "Illuminator brightness"]
17494 pub brightness: f32,
17495 #[doc = "Illuminator strobing period in seconds"]
17496 pub strobe_period: f32,
17497 #[doc = "Illuminator strobing duty cycle"]
17498 pub strobe_duty_cycle: f32,
17499 #[doc = "Temperature in Celsius"]
17500 pub temp_c: f32,
17501 #[doc = "Minimum strobing period in seconds"]
17502 pub min_strobe_period: f32,
17503 #[doc = "Maximum strobing period in seconds"]
17504 pub max_strobe_period: f32,
17505 #[doc = "0: Illuminators OFF, 1: Illuminators ON"]
17506 pub enable: u8,
17507 #[doc = "Supported illuminator modes"]
17508 pub mode_bitmask: IlluminatorMode,
17509 #[doc = "Illuminator mode"]
17510 pub mode: IlluminatorMode,
17511}
17512impl ILLUMINATOR_STATUS_DATA {
17513 pub const ENCODED_LEN: usize = 35usize;
17514 pub const DEFAULT: Self = Self {
17515 uptime_ms: 0_u32,
17516 error_status: IlluminatorErrorFlags::DEFAULT,
17517 brightness: 0.0_f32,
17518 strobe_period: 0.0_f32,
17519 strobe_duty_cycle: 0.0_f32,
17520 temp_c: 0.0_f32,
17521 min_strobe_period: 0.0_f32,
17522 max_strobe_period: 0.0_f32,
17523 enable: 0_u8,
17524 mode_bitmask: IlluminatorMode::DEFAULT,
17525 mode: IlluminatorMode::DEFAULT,
17526 };
17527 #[cfg(feature = "arbitrary")]
17528 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17529 use arbitrary::{Arbitrary, Unstructured};
17530 let mut buf = [0u8; 1024];
17531 rng.fill_bytes(&mut buf);
17532 let mut unstructured = Unstructured::new(&buf);
17533 Self::arbitrary(&mut unstructured).unwrap_or_default()
17534 }
17535}
17536impl Default for ILLUMINATOR_STATUS_DATA {
17537 fn default() -> Self {
17538 Self::DEFAULT.clone()
17539 }
17540}
17541impl MessageData for ILLUMINATOR_STATUS_DATA {
17542 type Message = MavMessage;
17543 const ID: u32 = 440u32;
17544 const NAME: &'static str = "ILLUMINATOR_STATUS";
17545 const EXTRA_CRC: u8 = 66u8;
17546 const ENCODED_LEN: usize = 35usize;
17547 fn deser(
17548 _version: MavlinkVersion,
17549 __input: &[u8],
17550 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17551 let avail_len = __input.len();
17552 let mut payload_buf = [0; Self::ENCODED_LEN];
17553 let mut buf = if avail_len < Self::ENCODED_LEN {
17554 payload_buf[0..avail_len].copy_from_slice(__input);
17555 Bytes::new(&payload_buf)
17556 } else {
17557 Bytes::new(__input)
17558 };
17559 let mut __struct = Self::default();
17560 __struct.uptime_ms = buf.get_u32_le();
17561 let tmp = buf.get_u32_le();
17562 __struct.error_status = IlluminatorErrorFlags::from_bits(
17563 tmp & IlluminatorErrorFlags::all().bits(),
17564 )
17565 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
17566 flag_type: "IlluminatorErrorFlags",
17567 value: tmp as u32,
17568 })?;
17569 __struct.brightness = buf.get_f32_le();
17570 __struct.strobe_period = buf.get_f32_le();
17571 __struct.strobe_duty_cycle = buf.get_f32_le();
17572 __struct.temp_c = buf.get_f32_le();
17573 __struct.min_strobe_period = buf.get_f32_le();
17574 __struct.max_strobe_period = buf.get_f32_le();
17575 __struct.enable = buf.get_u8();
17576 let tmp = buf.get_u8();
17577 __struct.mode_bitmask =
17578 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17579 enum_type: "IlluminatorMode",
17580 value: tmp as u32,
17581 })?;
17582 let tmp = buf.get_u8();
17583 __struct.mode =
17584 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17585 enum_type: "IlluminatorMode",
17586 value: tmp as u32,
17587 })?;
17588 Ok(__struct)
17589 }
17590 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17591 let mut __tmp = BytesMut::new(bytes);
17592 #[allow(clippy::absurd_extreme_comparisons)]
17593 #[allow(unused_comparisons)]
17594 if __tmp.remaining() < Self::ENCODED_LEN {
17595 panic!(
17596 "buffer is too small (need {} bytes, but got {})",
17597 Self::ENCODED_LEN,
17598 __tmp.remaining(),
17599 )
17600 }
17601 __tmp.put_u32_le(self.uptime_ms);
17602 __tmp.put_u32_le(self.error_status.bits());
17603 __tmp.put_f32_le(self.brightness);
17604 __tmp.put_f32_le(self.strobe_period);
17605 __tmp.put_f32_le(self.strobe_duty_cycle);
17606 __tmp.put_f32_le(self.temp_c);
17607 __tmp.put_f32_le(self.min_strobe_period);
17608 __tmp.put_f32_le(self.max_strobe_period);
17609 __tmp.put_u8(self.enable);
17610 __tmp.put_u8(self.mode_bitmask as u8);
17611 __tmp.put_u8(self.mode as u8);
17612 if matches!(version, MavlinkVersion::V2) {
17613 let len = __tmp.len();
17614 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17615 } else {
17616 __tmp.len()
17617 }
17618 }
17619}
17620#[doc = "Status of the Iridium SBD link."]
17621#[doc = ""]
17622#[doc = "ID: 335"]
17623#[derive(Debug, Clone, PartialEq)]
17624#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17625#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17626#[cfg_attr(feature = "ts", derive(TS))]
17627#[cfg_attr(feature = "ts", ts(export))]
17628pub struct ISBD_LINK_STATUS_DATA {
17629 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17630 pub timestamp: u64,
17631 #[doc = "Timestamp of the last successful sbd session. The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17632 pub last_heartbeat: u64,
17633 #[doc = "Number of failed SBD sessions."]
17634 pub failed_sessions: u16,
17635 #[doc = "Number of successful SBD sessions."]
17636 pub successful_sessions: u16,
17637 #[doc = "Signal quality equal to the number of bars displayed on the ISU signal strength indicator. Range is 0 to 5, where 0 indicates no signal and 5 indicates maximum signal strength."]
17638 pub signal_quality: u8,
17639 #[doc = "1: Ring call pending, 0: No call pending."]
17640 pub ring_pending: u8,
17641 #[doc = "1: Transmission session pending, 0: No transmission session pending."]
17642 pub tx_session_pending: u8,
17643 #[doc = "1: Receiving session pending, 0: No receiving session pending."]
17644 pub rx_session_pending: u8,
17645}
17646impl ISBD_LINK_STATUS_DATA {
17647 pub const ENCODED_LEN: usize = 24usize;
17648 pub const DEFAULT: Self = Self {
17649 timestamp: 0_u64,
17650 last_heartbeat: 0_u64,
17651 failed_sessions: 0_u16,
17652 successful_sessions: 0_u16,
17653 signal_quality: 0_u8,
17654 ring_pending: 0_u8,
17655 tx_session_pending: 0_u8,
17656 rx_session_pending: 0_u8,
17657 };
17658 #[cfg(feature = "arbitrary")]
17659 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17660 use arbitrary::{Arbitrary, Unstructured};
17661 let mut buf = [0u8; 1024];
17662 rng.fill_bytes(&mut buf);
17663 let mut unstructured = Unstructured::new(&buf);
17664 Self::arbitrary(&mut unstructured).unwrap_or_default()
17665 }
17666}
17667impl Default for ISBD_LINK_STATUS_DATA {
17668 fn default() -> Self {
17669 Self::DEFAULT.clone()
17670 }
17671}
17672impl MessageData for ISBD_LINK_STATUS_DATA {
17673 type Message = MavMessage;
17674 const ID: u32 = 335u32;
17675 const NAME: &'static str = "ISBD_LINK_STATUS";
17676 const EXTRA_CRC: u8 = 225u8;
17677 const ENCODED_LEN: usize = 24usize;
17678 fn deser(
17679 _version: MavlinkVersion,
17680 __input: &[u8],
17681 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17682 let avail_len = __input.len();
17683 let mut payload_buf = [0; Self::ENCODED_LEN];
17684 let mut buf = if avail_len < Self::ENCODED_LEN {
17685 payload_buf[0..avail_len].copy_from_slice(__input);
17686 Bytes::new(&payload_buf)
17687 } else {
17688 Bytes::new(__input)
17689 };
17690 let mut __struct = Self::default();
17691 __struct.timestamp = buf.get_u64_le();
17692 __struct.last_heartbeat = buf.get_u64_le();
17693 __struct.failed_sessions = buf.get_u16_le();
17694 __struct.successful_sessions = buf.get_u16_le();
17695 __struct.signal_quality = buf.get_u8();
17696 __struct.ring_pending = buf.get_u8();
17697 __struct.tx_session_pending = buf.get_u8();
17698 __struct.rx_session_pending = buf.get_u8();
17699 Ok(__struct)
17700 }
17701 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17702 let mut __tmp = BytesMut::new(bytes);
17703 #[allow(clippy::absurd_extreme_comparisons)]
17704 #[allow(unused_comparisons)]
17705 if __tmp.remaining() < Self::ENCODED_LEN {
17706 panic!(
17707 "buffer is too small (need {} bytes, but got {})",
17708 Self::ENCODED_LEN,
17709 __tmp.remaining(),
17710 )
17711 }
17712 __tmp.put_u64_le(self.timestamp);
17713 __tmp.put_u64_le(self.last_heartbeat);
17714 __tmp.put_u16_le(self.failed_sessions);
17715 __tmp.put_u16_le(self.successful_sessions);
17716 __tmp.put_u8(self.signal_quality);
17717 __tmp.put_u8(self.ring_pending);
17718 __tmp.put_u8(self.tx_session_pending);
17719 __tmp.put_u8(self.rx_session_pending);
17720 if matches!(version, MavlinkVersion::V2) {
17721 let len = __tmp.len();
17722 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17723 } else {
17724 __tmp.len()
17725 }
17726 }
17727}
17728#[doc = "The location of a landing target. See: <https://mavlink.io/en/services/landing_target.html>."]
17729#[doc = ""]
17730#[doc = "ID: 149"]
17731#[derive(Debug, Clone, PartialEq)]
17732#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17733#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17734#[cfg_attr(feature = "ts", derive(TS))]
17735#[cfg_attr(feature = "ts", ts(export))]
17736pub struct LANDING_TARGET_DATA {
17737 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17738 pub time_usec: u64,
17739 #[doc = "X-axis angular offset of the target from the center of the image"]
17740 pub angle_x: f32,
17741 #[doc = "Y-axis angular offset of the target from the center of the image"]
17742 pub angle_y: f32,
17743 #[doc = "Distance to the target from the vehicle"]
17744 pub distance: f32,
17745 #[doc = "Size of target along x-axis"]
17746 pub size_x: f32,
17747 #[doc = "Size of target along y-axis"]
17748 pub size_y: f32,
17749 #[doc = "The ID of the target if multiple targets are present"]
17750 pub target_num: u8,
17751 #[doc = "Coordinate frame used for following fields."]
17752 pub frame: MavFrame,
17753 #[doc = "X Position of the landing target in MAV_FRAME"]
17754 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17755 pub x: f32,
17756 #[doc = "Y Position of the landing target in MAV_FRAME"]
17757 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17758 pub y: f32,
17759 #[doc = "Z Position of the landing target in MAV_FRAME"]
17760 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17761 pub z: f32,
17762 #[doc = "Quaternion of landing target orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
17763 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17764 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17765 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
17766 pub q: [f32; 4],
17767 #[doc = "Type of landing target"]
17768 #[cfg_attr(feature = "serde", serde(default))]
17769 pub mavtype: LandingTargetType,
17770 #[doc = "Boolean indicating whether the position fields (x, y, z, q, type) contain valid target position information (valid: 1, invalid: 0). Default is 0 (invalid)."]
17771 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17772 pub position_valid: u8,
17773}
17774impl LANDING_TARGET_DATA {
17775 pub const ENCODED_LEN: usize = 60usize;
17776 pub const DEFAULT: Self = Self {
17777 time_usec: 0_u64,
17778 angle_x: 0.0_f32,
17779 angle_y: 0.0_f32,
17780 distance: 0.0_f32,
17781 size_x: 0.0_f32,
17782 size_y: 0.0_f32,
17783 target_num: 0_u8,
17784 frame: MavFrame::DEFAULT,
17785 x: 0.0_f32,
17786 y: 0.0_f32,
17787 z: 0.0_f32,
17788 q: [0.0_f32; 4usize],
17789 mavtype: LandingTargetType::DEFAULT,
17790 position_valid: 0_u8,
17791 };
17792 #[cfg(feature = "arbitrary")]
17793 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17794 use arbitrary::{Arbitrary, Unstructured};
17795 let mut buf = [0u8; 1024];
17796 rng.fill_bytes(&mut buf);
17797 let mut unstructured = Unstructured::new(&buf);
17798 Self::arbitrary(&mut unstructured).unwrap_or_default()
17799 }
17800}
17801impl Default for LANDING_TARGET_DATA {
17802 fn default() -> Self {
17803 Self::DEFAULT.clone()
17804 }
17805}
17806impl MessageData for LANDING_TARGET_DATA {
17807 type Message = MavMessage;
17808 const ID: u32 = 149u32;
17809 const NAME: &'static str = "LANDING_TARGET";
17810 const EXTRA_CRC: u8 = 200u8;
17811 const ENCODED_LEN: usize = 60usize;
17812 fn deser(
17813 _version: MavlinkVersion,
17814 __input: &[u8],
17815 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17816 let avail_len = __input.len();
17817 let mut payload_buf = [0; Self::ENCODED_LEN];
17818 let mut buf = if avail_len < Self::ENCODED_LEN {
17819 payload_buf[0..avail_len].copy_from_slice(__input);
17820 Bytes::new(&payload_buf)
17821 } else {
17822 Bytes::new(__input)
17823 };
17824 let mut __struct = Self::default();
17825 __struct.time_usec = buf.get_u64_le();
17826 __struct.angle_x = buf.get_f32_le();
17827 __struct.angle_y = buf.get_f32_le();
17828 __struct.distance = buf.get_f32_le();
17829 __struct.size_x = buf.get_f32_le();
17830 __struct.size_y = buf.get_f32_le();
17831 __struct.target_num = buf.get_u8();
17832 let tmp = buf.get_u8();
17833 __struct.frame =
17834 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17835 enum_type: "MavFrame",
17836 value: tmp as u32,
17837 })?;
17838 __struct.x = buf.get_f32_le();
17839 __struct.y = buf.get_f32_le();
17840 __struct.z = buf.get_f32_le();
17841 for v in &mut __struct.q {
17842 let val = buf.get_f32_le();
17843 *v = val;
17844 }
17845 let tmp = buf.get_u8();
17846 __struct.mavtype =
17847 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17848 enum_type: "LandingTargetType",
17849 value: tmp as u32,
17850 })?;
17851 __struct.position_valid = buf.get_u8();
17852 Ok(__struct)
17853 }
17854 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17855 let mut __tmp = BytesMut::new(bytes);
17856 #[allow(clippy::absurd_extreme_comparisons)]
17857 #[allow(unused_comparisons)]
17858 if __tmp.remaining() < Self::ENCODED_LEN {
17859 panic!(
17860 "buffer is too small (need {} bytes, but got {})",
17861 Self::ENCODED_LEN,
17862 __tmp.remaining(),
17863 )
17864 }
17865 __tmp.put_u64_le(self.time_usec);
17866 __tmp.put_f32_le(self.angle_x);
17867 __tmp.put_f32_le(self.angle_y);
17868 __tmp.put_f32_le(self.distance);
17869 __tmp.put_f32_le(self.size_x);
17870 __tmp.put_f32_le(self.size_y);
17871 __tmp.put_u8(self.target_num);
17872 __tmp.put_u8(self.frame as u8);
17873 if matches!(version, MavlinkVersion::V2) {
17874 __tmp.put_f32_le(self.x);
17875 __tmp.put_f32_le(self.y);
17876 __tmp.put_f32_le(self.z);
17877 for val in &self.q {
17878 __tmp.put_f32_le(*val);
17879 }
17880 __tmp.put_u8(self.mavtype as u8);
17881 __tmp.put_u8(self.position_valid);
17882 let len = __tmp.len();
17883 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17884 } else {
17885 __tmp.len()
17886 }
17887 }
17888}
17889#[doc = "Status generated in each node in the communication chain and injected into MAVLink stream."]
17890#[doc = ""]
17891#[doc = "ID: 8"]
17892#[derive(Debug, Clone, PartialEq)]
17893#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17894#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17895#[cfg_attr(feature = "ts", derive(TS))]
17896#[cfg_attr(feature = "ts", ts(export))]
17897pub struct LINK_NODE_STATUS_DATA {
17898 #[doc = "Timestamp (time since system boot)."]
17899 pub timestamp: u64,
17900 #[doc = "Transmit rate"]
17901 pub tx_rate: u32,
17902 #[doc = "Receive rate"]
17903 pub rx_rate: u32,
17904 #[doc = "Messages sent"]
17905 pub messages_sent: u32,
17906 #[doc = "Messages received (estimated from counting seq)"]
17907 pub messages_received: u32,
17908 #[doc = "Messages lost (estimated from counting seq)"]
17909 pub messages_lost: u32,
17910 #[doc = "Number of bytes that could not be parsed correctly."]
17911 pub rx_parse_err: u16,
17912 #[doc = "Transmit buffer overflows. This number wraps around as it reaches UINT16_MAX"]
17913 pub tx_overflows: u16,
17914 #[doc = "Receive buffer overflows. This number wraps around as it reaches UINT16_MAX"]
17915 pub rx_overflows: u16,
17916 #[doc = "Remaining free transmit buffer space"]
17917 pub tx_buf: u8,
17918 #[doc = "Remaining free receive buffer space"]
17919 pub rx_buf: u8,
17920}
17921impl LINK_NODE_STATUS_DATA {
17922 pub const ENCODED_LEN: usize = 36usize;
17923 pub const DEFAULT: Self = Self {
17924 timestamp: 0_u64,
17925 tx_rate: 0_u32,
17926 rx_rate: 0_u32,
17927 messages_sent: 0_u32,
17928 messages_received: 0_u32,
17929 messages_lost: 0_u32,
17930 rx_parse_err: 0_u16,
17931 tx_overflows: 0_u16,
17932 rx_overflows: 0_u16,
17933 tx_buf: 0_u8,
17934 rx_buf: 0_u8,
17935 };
17936 #[cfg(feature = "arbitrary")]
17937 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17938 use arbitrary::{Arbitrary, Unstructured};
17939 let mut buf = [0u8; 1024];
17940 rng.fill_bytes(&mut buf);
17941 let mut unstructured = Unstructured::new(&buf);
17942 Self::arbitrary(&mut unstructured).unwrap_or_default()
17943 }
17944}
17945impl Default for LINK_NODE_STATUS_DATA {
17946 fn default() -> Self {
17947 Self::DEFAULT.clone()
17948 }
17949}
17950impl MessageData for LINK_NODE_STATUS_DATA {
17951 type Message = MavMessage;
17952 const ID: u32 = 8u32;
17953 const NAME: &'static str = "LINK_NODE_STATUS";
17954 const EXTRA_CRC: u8 = 117u8;
17955 const ENCODED_LEN: usize = 36usize;
17956 fn deser(
17957 _version: MavlinkVersion,
17958 __input: &[u8],
17959 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17960 let avail_len = __input.len();
17961 let mut payload_buf = [0; Self::ENCODED_LEN];
17962 let mut buf = if avail_len < Self::ENCODED_LEN {
17963 payload_buf[0..avail_len].copy_from_slice(__input);
17964 Bytes::new(&payload_buf)
17965 } else {
17966 Bytes::new(__input)
17967 };
17968 let mut __struct = Self::default();
17969 __struct.timestamp = buf.get_u64_le();
17970 __struct.tx_rate = buf.get_u32_le();
17971 __struct.rx_rate = buf.get_u32_le();
17972 __struct.messages_sent = buf.get_u32_le();
17973 __struct.messages_received = buf.get_u32_le();
17974 __struct.messages_lost = buf.get_u32_le();
17975 __struct.rx_parse_err = buf.get_u16_le();
17976 __struct.tx_overflows = buf.get_u16_le();
17977 __struct.rx_overflows = buf.get_u16_le();
17978 __struct.tx_buf = buf.get_u8();
17979 __struct.rx_buf = buf.get_u8();
17980 Ok(__struct)
17981 }
17982 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17983 let mut __tmp = BytesMut::new(bytes);
17984 #[allow(clippy::absurd_extreme_comparisons)]
17985 #[allow(unused_comparisons)]
17986 if __tmp.remaining() < Self::ENCODED_LEN {
17987 panic!(
17988 "buffer is too small (need {} bytes, but got {})",
17989 Self::ENCODED_LEN,
17990 __tmp.remaining(),
17991 )
17992 }
17993 __tmp.put_u64_le(self.timestamp);
17994 __tmp.put_u32_le(self.tx_rate);
17995 __tmp.put_u32_le(self.rx_rate);
17996 __tmp.put_u32_le(self.messages_sent);
17997 __tmp.put_u32_le(self.messages_received);
17998 __tmp.put_u32_le(self.messages_lost);
17999 __tmp.put_u16_le(self.rx_parse_err);
18000 __tmp.put_u16_le(self.tx_overflows);
18001 __tmp.put_u16_le(self.rx_overflows);
18002 __tmp.put_u8(self.tx_buf);
18003 __tmp.put_u8(self.rx_buf);
18004 if matches!(version, MavlinkVersion::V2) {
18005 let len = __tmp.len();
18006 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18007 } else {
18008 __tmp.len()
18009 }
18010 }
18011}
18012#[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
18013#[doc = ""]
18014#[doc = "ID: 32"]
18015#[derive(Debug, Clone, PartialEq)]
18016#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18017#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18018#[cfg_attr(feature = "ts", derive(TS))]
18019#[cfg_attr(feature = "ts", ts(export))]
18020pub struct LOCAL_POSITION_NED_DATA {
18021 #[doc = "Timestamp (time since system boot)."]
18022 pub time_boot_ms: u32,
18023 #[doc = "X Position"]
18024 pub x: f32,
18025 #[doc = "Y Position"]
18026 pub y: f32,
18027 #[doc = "Z Position"]
18028 pub z: f32,
18029 #[doc = "X Speed"]
18030 pub vx: f32,
18031 #[doc = "Y Speed"]
18032 pub vy: f32,
18033 #[doc = "Z Speed"]
18034 pub vz: f32,
18035}
18036impl LOCAL_POSITION_NED_DATA {
18037 pub const ENCODED_LEN: usize = 28usize;
18038 pub const DEFAULT: Self = Self {
18039 time_boot_ms: 0_u32,
18040 x: 0.0_f32,
18041 y: 0.0_f32,
18042 z: 0.0_f32,
18043 vx: 0.0_f32,
18044 vy: 0.0_f32,
18045 vz: 0.0_f32,
18046 };
18047 #[cfg(feature = "arbitrary")]
18048 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18049 use arbitrary::{Arbitrary, Unstructured};
18050 let mut buf = [0u8; 1024];
18051 rng.fill_bytes(&mut buf);
18052 let mut unstructured = Unstructured::new(&buf);
18053 Self::arbitrary(&mut unstructured).unwrap_or_default()
18054 }
18055}
18056impl Default for LOCAL_POSITION_NED_DATA {
18057 fn default() -> Self {
18058 Self::DEFAULT.clone()
18059 }
18060}
18061impl MessageData for LOCAL_POSITION_NED_DATA {
18062 type Message = MavMessage;
18063 const ID: u32 = 32u32;
18064 const NAME: &'static str = "LOCAL_POSITION_NED";
18065 const EXTRA_CRC: u8 = 185u8;
18066 const ENCODED_LEN: usize = 28usize;
18067 fn deser(
18068 _version: MavlinkVersion,
18069 __input: &[u8],
18070 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18071 let avail_len = __input.len();
18072 let mut payload_buf = [0; Self::ENCODED_LEN];
18073 let mut buf = if avail_len < Self::ENCODED_LEN {
18074 payload_buf[0..avail_len].copy_from_slice(__input);
18075 Bytes::new(&payload_buf)
18076 } else {
18077 Bytes::new(__input)
18078 };
18079 let mut __struct = Self::default();
18080 __struct.time_boot_ms = buf.get_u32_le();
18081 __struct.x = buf.get_f32_le();
18082 __struct.y = buf.get_f32_le();
18083 __struct.z = buf.get_f32_le();
18084 __struct.vx = buf.get_f32_le();
18085 __struct.vy = buf.get_f32_le();
18086 __struct.vz = buf.get_f32_le();
18087 Ok(__struct)
18088 }
18089 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18090 let mut __tmp = BytesMut::new(bytes);
18091 #[allow(clippy::absurd_extreme_comparisons)]
18092 #[allow(unused_comparisons)]
18093 if __tmp.remaining() < Self::ENCODED_LEN {
18094 panic!(
18095 "buffer is too small (need {} bytes, but got {})",
18096 Self::ENCODED_LEN,
18097 __tmp.remaining(),
18098 )
18099 }
18100 __tmp.put_u32_le(self.time_boot_ms);
18101 __tmp.put_f32_le(self.x);
18102 __tmp.put_f32_le(self.y);
18103 __tmp.put_f32_le(self.z);
18104 __tmp.put_f32_le(self.vx);
18105 __tmp.put_f32_le(self.vy);
18106 __tmp.put_f32_le(self.vz);
18107 if matches!(version, MavlinkVersion::V2) {
18108 let len = __tmp.len();
18109 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18110 } else {
18111 __tmp.len()
18112 }
18113 }
18114}
18115#[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
18116#[doc = ""]
18117#[doc = "ID: 64"]
18118#[derive(Debug, Clone, PartialEq)]
18119#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18120#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18121#[cfg_attr(feature = "ts", derive(TS))]
18122#[cfg_attr(feature = "ts", ts(export))]
18123pub struct LOCAL_POSITION_NED_COV_DATA {
18124 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
18125 pub time_usec: u64,
18126 #[doc = "X Position"]
18127 pub x: f32,
18128 #[doc = "Y Position"]
18129 pub y: f32,
18130 #[doc = "Z Position"]
18131 pub z: f32,
18132 #[doc = "X Speed"]
18133 pub vx: f32,
18134 #[doc = "Y Speed"]
18135 pub vy: f32,
18136 #[doc = "Z Speed"]
18137 pub vz: f32,
18138 #[doc = "X Acceleration"]
18139 pub ax: f32,
18140 #[doc = "Y Acceleration"]
18141 pub ay: f32,
18142 #[doc = "Z Acceleration"]
18143 pub az: f32,
18144 #[doc = "Row-major representation of position, velocity and acceleration 9x9 cross-covariance matrix upper right triangle (states: x, y, z, vx, vy, vz, ax, ay, az; first nine entries are the first ROW, next eight entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
18145 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18146 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
18147 pub covariance: [f32; 45],
18148 #[doc = "Class id of the estimator this estimate originated from."]
18149 pub estimator_type: MavEstimatorType,
18150}
18151impl LOCAL_POSITION_NED_COV_DATA {
18152 pub const ENCODED_LEN: usize = 225usize;
18153 pub const DEFAULT: Self = Self {
18154 time_usec: 0_u64,
18155 x: 0.0_f32,
18156 y: 0.0_f32,
18157 z: 0.0_f32,
18158 vx: 0.0_f32,
18159 vy: 0.0_f32,
18160 vz: 0.0_f32,
18161 ax: 0.0_f32,
18162 ay: 0.0_f32,
18163 az: 0.0_f32,
18164 covariance: [0.0_f32; 45usize],
18165 estimator_type: MavEstimatorType::DEFAULT,
18166 };
18167 #[cfg(feature = "arbitrary")]
18168 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18169 use arbitrary::{Arbitrary, Unstructured};
18170 let mut buf = [0u8; 1024];
18171 rng.fill_bytes(&mut buf);
18172 let mut unstructured = Unstructured::new(&buf);
18173 Self::arbitrary(&mut unstructured).unwrap_or_default()
18174 }
18175}
18176impl Default for LOCAL_POSITION_NED_COV_DATA {
18177 fn default() -> Self {
18178 Self::DEFAULT.clone()
18179 }
18180}
18181impl MessageData for LOCAL_POSITION_NED_COV_DATA {
18182 type Message = MavMessage;
18183 const ID: u32 = 64u32;
18184 const NAME: &'static str = "LOCAL_POSITION_NED_COV";
18185 const EXTRA_CRC: u8 = 191u8;
18186 const ENCODED_LEN: usize = 225usize;
18187 fn deser(
18188 _version: MavlinkVersion,
18189 __input: &[u8],
18190 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18191 let avail_len = __input.len();
18192 let mut payload_buf = [0; Self::ENCODED_LEN];
18193 let mut buf = if avail_len < Self::ENCODED_LEN {
18194 payload_buf[0..avail_len].copy_from_slice(__input);
18195 Bytes::new(&payload_buf)
18196 } else {
18197 Bytes::new(__input)
18198 };
18199 let mut __struct = Self::default();
18200 __struct.time_usec = buf.get_u64_le();
18201 __struct.x = buf.get_f32_le();
18202 __struct.y = buf.get_f32_le();
18203 __struct.z = buf.get_f32_le();
18204 __struct.vx = buf.get_f32_le();
18205 __struct.vy = buf.get_f32_le();
18206 __struct.vz = buf.get_f32_le();
18207 __struct.ax = buf.get_f32_le();
18208 __struct.ay = buf.get_f32_le();
18209 __struct.az = buf.get_f32_le();
18210 for v in &mut __struct.covariance {
18211 let val = buf.get_f32_le();
18212 *v = val;
18213 }
18214 let tmp = buf.get_u8();
18215 __struct.estimator_type =
18216 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18217 enum_type: "MavEstimatorType",
18218 value: tmp as u32,
18219 })?;
18220 Ok(__struct)
18221 }
18222 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18223 let mut __tmp = BytesMut::new(bytes);
18224 #[allow(clippy::absurd_extreme_comparisons)]
18225 #[allow(unused_comparisons)]
18226 if __tmp.remaining() < Self::ENCODED_LEN {
18227 panic!(
18228 "buffer is too small (need {} bytes, but got {})",
18229 Self::ENCODED_LEN,
18230 __tmp.remaining(),
18231 )
18232 }
18233 __tmp.put_u64_le(self.time_usec);
18234 __tmp.put_f32_le(self.x);
18235 __tmp.put_f32_le(self.y);
18236 __tmp.put_f32_le(self.z);
18237 __tmp.put_f32_le(self.vx);
18238 __tmp.put_f32_le(self.vy);
18239 __tmp.put_f32_le(self.vz);
18240 __tmp.put_f32_le(self.ax);
18241 __tmp.put_f32_le(self.ay);
18242 __tmp.put_f32_le(self.az);
18243 for val in &self.covariance {
18244 __tmp.put_f32_le(*val);
18245 }
18246 __tmp.put_u8(self.estimator_type as u8);
18247 if matches!(version, MavlinkVersion::V2) {
18248 let len = __tmp.len();
18249 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18250 } else {
18251 __tmp.len()
18252 }
18253 }
18254}
18255#[doc = "The offset in X, Y, Z and yaw between the LOCAL_POSITION_NED messages of MAV X and the global coordinate frame in NED coordinates. Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
18256#[doc = ""]
18257#[doc = "ID: 89"]
18258#[derive(Debug, Clone, PartialEq)]
18259#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18260#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18261#[cfg_attr(feature = "ts", derive(TS))]
18262#[cfg_attr(feature = "ts", ts(export))]
18263pub struct LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
18264 #[doc = "Timestamp (time since system boot)."]
18265 pub time_boot_ms: u32,
18266 #[doc = "X Position"]
18267 pub x: f32,
18268 #[doc = "Y Position"]
18269 pub y: f32,
18270 #[doc = "Z Position"]
18271 pub z: f32,
18272 #[doc = "Roll"]
18273 pub roll: f32,
18274 #[doc = "Pitch"]
18275 pub pitch: f32,
18276 #[doc = "Yaw"]
18277 pub yaw: f32,
18278}
18279impl LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
18280 pub const ENCODED_LEN: usize = 28usize;
18281 pub const DEFAULT: Self = Self {
18282 time_boot_ms: 0_u32,
18283 x: 0.0_f32,
18284 y: 0.0_f32,
18285 z: 0.0_f32,
18286 roll: 0.0_f32,
18287 pitch: 0.0_f32,
18288 yaw: 0.0_f32,
18289 };
18290 #[cfg(feature = "arbitrary")]
18291 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18292 use arbitrary::{Arbitrary, Unstructured};
18293 let mut buf = [0u8; 1024];
18294 rng.fill_bytes(&mut buf);
18295 let mut unstructured = Unstructured::new(&buf);
18296 Self::arbitrary(&mut unstructured).unwrap_or_default()
18297 }
18298}
18299impl Default for LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
18300 fn default() -> Self {
18301 Self::DEFAULT.clone()
18302 }
18303}
18304impl MessageData for LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
18305 type Message = MavMessage;
18306 const ID: u32 = 89u32;
18307 const NAME: &'static str = "LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET";
18308 const EXTRA_CRC: u8 = 231u8;
18309 const ENCODED_LEN: usize = 28usize;
18310 fn deser(
18311 _version: MavlinkVersion,
18312 __input: &[u8],
18313 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18314 let avail_len = __input.len();
18315 let mut payload_buf = [0; Self::ENCODED_LEN];
18316 let mut buf = if avail_len < Self::ENCODED_LEN {
18317 payload_buf[0..avail_len].copy_from_slice(__input);
18318 Bytes::new(&payload_buf)
18319 } else {
18320 Bytes::new(__input)
18321 };
18322 let mut __struct = Self::default();
18323 __struct.time_boot_ms = buf.get_u32_le();
18324 __struct.x = buf.get_f32_le();
18325 __struct.y = buf.get_f32_le();
18326 __struct.z = buf.get_f32_le();
18327 __struct.roll = buf.get_f32_le();
18328 __struct.pitch = buf.get_f32_le();
18329 __struct.yaw = buf.get_f32_le();
18330 Ok(__struct)
18331 }
18332 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18333 let mut __tmp = BytesMut::new(bytes);
18334 #[allow(clippy::absurd_extreme_comparisons)]
18335 #[allow(unused_comparisons)]
18336 if __tmp.remaining() < Self::ENCODED_LEN {
18337 panic!(
18338 "buffer is too small (need {} bytes, but got {})",
18339 Self::ENCODED_LEN,
18340 __tmp.remaining(),
18341 )
18342 }
18343 __tmp.put_u32_le(self.time_boot_ms);
18344 __tmp.put_f32_le(self.x);
18345 __tmp.put_f32_le(self.y);
18346 __tmp.put_f32_le(self.z);
18347 __tmp.put_f32_le(self.roll);
18348 __tmp.put_f32_le(self.pitch);
18349 __tmp.put_f32_le(self.yaw);
18350 if matches!(version, MavlinkVersion::V2) {
18351 let len = __tmp.len();
18352 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18353 } else {
18354 __tmp.len()
18355 }
18356 }
18357}
18358#[doc = "An ack for a LOGGING_DATA_ACKED message."]
18359#[doc = ""]
18360#[doc = "ID: 268"]
18361#[derive(Debug, Clone, PartialEq)]
18362#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18363#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18364#[cfg_attr(feature = "ts", derive(TS))]
18365#[cfg_attr(feature = "ts", ts(export))]
18366pub struct LOGGING_ACK_DATA {
18367 #[doc = "sequence number (must match the one in LOGGING_DATA_ACKED)"]
18368 pub sequence: u16,
18369 #[doc = "system ID of the target"]
18370 pub target_system: u8,
18371 #[doc = "component ID of the target"]
18372 pub target_component: u8,
18373}
18374impl LOGGING_ACK_DATA {
18375 pub const ENCODED_LEN: usize = 4usize;
18376 pub const DEFAULT: Self = Self {
18377 sequence: 0_u16,
18378 target_system: 0_u8,
18379 target_component: 0_u8,
18380 };
18381 #[cfg(feature = "arbitrary")]
18382 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18383 use arbitrary::{Arbitrary, Unstructured};
18384 let mut buf = [0u8; 1024];
18385 rng.fill_bytes(&mut buf);
18386 let mut unstructured = Unstructured::new(&buf);
18387 Self::arbitrary(&mut unstructured).unwrap_or_default()
18388 }
18389}
18390impl Default for LOGGING_ACK_DATA {
18391 fn default() -> Self {
18392 Self::DEFAULT.clone()
18393 }
18394}
18395impl MessageData for LOGGING_ACK_DATA {
18396 type Message = MavMessage;
18397 const ID: u32 = 268u32;
18398 const NAME: &'static str = "LOGGING_ACK";
18399 const EXTRA_CRC: u8 = 14u8;
18400 const ENCODED_LEN: usize = 4usize;
18401 fn deser(
18402 _version: MavlinkVersion,
18403 __input: &[u8],
18404 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18405 let avail_len = __input.len();
18406 let mut payload_buf = [0; Self::ENCODED_LEN];
18407 let mut buf = if avail_len < Self::ENCODED_LEN {
18408 payload_buf[0..avail_len].copy_from_slice(__input);
18409 Bytes::new(&payload_buf)
18410 } else {
18411 Bytes::new(__input)
18412 };
18413 let mut __struct = Self::default();
18414 __struct.sequence = buf.get_u16_le();
18415 __struct.target_system = buf.get_u8();
18416 __struct.target_component = buf.get_u8();
18417 Ok(__struct)
18418 }
18419 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18420 let mut __tmp = BytesMut::new(bytes);
18421 #[allow(clippy::absurd_extreme_comparisons)]
18422 #[allow(unused_comparisons)]
18423 if __tmp.remaining() < Self::ENCODED_LEN {
18424 panic!(
18425 "buffer is too small (need {} bytes, but got {})",
18426 Self::ENCODED_LEN,
18427 __tmp.remaining(),
18428 )
18429 }
18430 __tmp.put_u16_le(self.sequence);
18431 __tmp.put_u8(self.target_system);
18432 __tmp.put_u8(self.target_component);
18433 if matches!(version, MavlinkVersion::V2) {
18434 let len = __tmp.len();
18435 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18436 } else {
18437 __tmp.len()
18438 }
18439 }
18440}
18441#[doc = "A message containing logged data (see also MAV_CMD_LOGGING_START)."]
18442#[doc = ""]
18443#[doc = "ID: 266"]
18444#[derive(Debug, Clone, PartialEq)]
18445#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18446#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18447#[cfg_attr(feature = "ts", derive(TS))]
18448#[cfg_attr(feature = "ts", ts(export))]
18449pub struct LOGGING_DATA_DATA {
18450 #[doc = "sequence number (can wrap)"]
18451 pub sequence: u16,
18452 #[doc = "system ID of the target"]
18453 pub target_system: u8,
18454 #[doc = "component ID of the target"]
18455 pub target_component: u8,
18456 #[doc = "data length"]
18457 pub length: u8,
18458 #[doc = "offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to UINT8_MAX if no start exists)."]
18459 pub first_message_offset: u8,
18460 #[doc = "logged data"]
18461 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18462 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
18463 pub data: [u8; 249],
18464}
18465impl LOGGING_DATA_DATA {
18466 pub const ENCODED_LEN: usize = 255usize;
18467 pub const DEFAULT: Self = Self {
18468 sequence: 0_u16,
18469 target_system: 0_u8,
18470 target_component: 0_u8,
18471 length: 0_u8,
18472 first_message_offset: 0_u8,
18473 data: [0_u8; 249usize],
18474 };
18475 #[cfg(feature = "arbitrary")]
18476 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18477 use arbitrary::{Arbitrary, Unstructured};
18478 let mut buf = [0u8; 1024];
18479 rng.fill_bytes(&mut buf);
18480 let mut unstructured = Unstructured::new(&buf);
18481 Self::arbitrary(&mut unstructured).unwrap_or_default()
18482 }
18483}
18484impl Default for LOGGING_DATA_DATA {
18485 fn default() -> Self {
18486 Self::DEFAULT.clone()
18487 }
18488}
18489impl MessageData for LOGGING_DATA_DATA {
18490 type Message = MavMessage;
18491 const ID: u32 = 266u32;
18492 const NAME: &'static str = "LOGGING_DATA";
18493 const EXTRA_CRC: u8 = 193u8;
18494 const ENCODED_LEN: usize = 255usize;
18495 fn deser(
18496 _version: MavlinkVersion,
18497 __input: &[u8],
18498 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18499 let avail_len = __input.len();
18500 let mut payload_buf = [0; Self::ENCODED_LEN];
18501 let mut buf = if avail_len < Self::ENCODED_LEN {
18502 payload_buf[0..avail_len].copy_from_slice(__input);
18503 Bytes::new(&payload_buf)
18504 } else {
18505 Bytes::new(__input)
18506 };
18507 let mut __struct = Self::default();
18508 __struct.sequence = buf.get_u16_le();
18509 __struct.target_system = buf.get_u8();
18510 __struct.target_component = buf.get_u8();
18511 __struct.length = buf.get_u8();
18512 __struct.first_message_offset = buf.get_u8();
18513 for v in &mut __struct.data {
18514 let val = buf.get_u8();
18515 *v = val;
18516 }
18517 Ok(__struct)
18518 }
18519 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18520 let mut __tmp = BytesMut::new(bytes);
18521 #[allow(clippy::absurd_extreme_comparisons)]
18522 #[allow(unused_comparisons)]
18523 if __tmp.remaining() < Self::ENCODED_LEN {
18524 panic!(
18525 "buffer is too small (need {} bytes, but got {})",
18526 Self::ENCODED_LEN,
18527 __tmp.remaining(),
18528 )
18529 }
18530 __tmp.put_u16_le(self.sequence);
18531 __tmp.put_u8(self.target_system);
18532 __tmp.put_u8(self.target_component);
18533 __tmp.put_u8(self.length);
18534 __tmp.put_u8(self.first_message_offset);
18535 for val in &self.data {
18536 __tmp.put_u8(*val);
18537 }
18538 if matches!(version, MavlinkVersion::V2) {
18539 let len = __tmp.len();
18540 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18541 } else {
18542 __tmp.len()
18543 }
18544 }
18545}
18546#[doc = "A message containing logged data which requires a LOGGING_ACK to be sent back."]
18547#[doc = ""]
18548#[doc = "ID: 267"]
18549#[derive(Debug, Clone, PartialEq)]
18550#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18551#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18552#[cfg_attr(feature = "ts", derive(TS))]
18553#[cfg_attr(feature = "ts", ts(export))]
18554pub struct LOGGING_DATA_ACKED_DATA {
18555 #[doc = "sequence number (can wrap)"]
18556 pub sequence: u16,
18557 #[doc = "system ID of the target"]
18558 pub target_system: u8,
18559 #[doc = "component ID of the target"]
18560 pub target_component: u8,
18561 #[doc = "data length"]
18562 pub length: u8,
18563 #[doc = "offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to UINT8_MAX if no start exists)."]
18564 pub first_message_offset: u8,
18565 #[doc = "logged data"]
18566 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18567 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
18568 pub data: [u8; 249],
18569}
18570impl LOGGING_DATA_ACKED_DATA {
18571 pub const ENCODED_LEN: usize = 255usize;
18572 pub const DEFAULT: Self = Self {
18573 sequence: 0_u16,
18574 target_system: 0_u8,
18575 target_component: 0_u8,
18576 length: 0_u8,
18577 first_message_offset: 0_u8,
18578 data: [0_u8; 249usize],
18579 };
18580 #[cfg(feature = "arbitrary")]
18581 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18582 use arbitrary::{Arbitrary, Unstructured};
18583 let mut buf = [0u8; 1024];
18584 rng.fill_bytes(&mut buf);
18585 let mut unstructured = Unstructured::new(&buf);
18586 Self::arbitrary(&mut unstructured).unwrap_or_default()
18587 }
18588}
18589impl Default for LOGGING_DATA_ACKED_DATA {
18590 fn default() -> Self {
18591 Self::DEFAULT.clone()
18592 }
18593}
18594impl MessageData for LOGGING_DATA_ACKED_DATA {
18595 type Message = MavMessage;
18596 const ID: u32 = 267u32;
18597 const NAME: &'static str = "LOGGING_DATA_ACKED";
18598 const EXTRA_CRC: u8 = 35u8;
18599 const ENCODED_LEN: usize = 255usize;
18600 fn deser(
18601 _version: MavlinkVersion,
18602 __input: &[u8],
18603 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18604 let avail_len = __input.len();
18605 let mut payload_buf = [0; Self::ENCODED_LEN];
18606 let mut buf = if avail_len < Self::ENCODED_LEN {
18607 payload_buf[0..avail_len].copy_from_slice(__input);
18608 Bytes::new(&payload_buf)
18609 } else {
18610 Bytes::new(__input)
18611 };
18612 let mut __struct = Self::default();
18613 __struct.sequence = buf.get_u16_le();
18614 __struct.target_system = buf.get_u8();
18615 __struct.target_component = buf.get_u8();
18616 __struct.length = buf.get_u8();
18617 __struct.first_message_offset = buf.get_u8();
18618 for v in &mut __struct.data {
18619 let val = buf.get_u8();
18620 *v = val;
18621 }
18622 Ok(__struct)
18623 }
18624 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18625 let mut __tmp = BytesMut::new(bytes);
18626 #[allow(clippy::absurd_extreme_comparisons)]
18627 #[allow(unused_comparisons)]
18628 if __tmp.remaining() < Self::ENCODED_LEN {
18629 panic!(
18630 "buffer is too small (need {} bytes, but got {})",
18631 Self::ENCODED_LEN,
18632 __tmp.remaining(),
18633 )
18634 }
18635 __tmp.put_u16_le(self.sequence);
18636 __tmp.put_u8(self.target_system);
18637 __tmp.put_u8(self.target_component);
18638 __tmp.put_u8(self.length);
18639 __tmp.put_u8(self.first_message_offset);
18640 for val in &self.data {
18641 __tmp.put_u8(*val);
18642 }
18643 if matches!(version, MavlinkVersion::V2) {
18644 let len = __tmp.len();
18645 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18646 } else {
18647 __tmp.len()
18648 }
18649 }
18650}
18651#[doc = "Reply to LOG_REQUEST_DATA."]
18652#[doc = ""]
18653#[doc = "ID: 120"]
18654#[derive(Debug, Clone, PartialEq)]
18655#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18656#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18657#[cfg_attr(feature = "ts", derive(TS))]
18658#[cfg_attr(feature = "ts", ts(export))]
18659pub struct LOG_DATA_DATA {
18660 #[doc = "Offset into the log"]
18661 pub ofs: u32,
18662 #[doc = "Log id (from LOG_ENTRY reply)"]
18663 pub id: u16,
18664 #[doc = "Number of bytes (zero for end of log)"]
18665 pub count: u8,
18666 #[doc = "log data"]
18667 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18668 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
18669 pub data: [u8; 90],
18670}
18671impl LOG_DATA_DATA {
18672 pub const ENCODED_LEN: usize = 97usize;
18673 pub const DEFAULT: Self = Self {
18674 ofs: 0_u32,
18675 id: 0_u16,
18676 count: 0_u8,
18677 data: [0_u8; 90usize],
18678 };
18679 #[cfg(feature = "arbitrary")]
18680 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18681 use arbitrary::{Arbitrary, Unstructured};
18682 let mut buf = [0u8; 1024];
18683 rng.fill_bytes(&mut buf);
18684 let mut unstructured = Unstructured::new(&buf);
18685 Self::arbitrary(&mut unstructured).unwrap_or_default()
18686 }
18687}
18688impl Default for LOG_DATA_DATA {
18689 fn default() -> Self {
18690 Self::DEFAULT.clone()
18691 }
18692}
18693impl MessageData for LOG_DATA_DATA {
18694 type Message = MavMessage;
18695 const ID: u32 = 120u32;
18696 const NAME: &'static str = "LOG_DATA";
18697 const EXTRA_CRC: u8 = 134u8;
18698 const ENCODED_LEN: usize = 97usize;
18699 fn deser(
18700 _version: MavlinkVersion,
18701 __input: &[u8],
18702 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18703 let avail_len = __input.len();
18704 let mut payload_buf = [0; Self::ENCODED_LEN];
18705 let mut buf = if avail_len < Self::ENCODED_LEN {
18706 payload_buf[0..avail_len].copy_from_slice(__input);
18707 Bytes::new(&payload_buf)
18708 } else {
18709 Bytes::new(__input)
18710 };
18711 let mut __struct = Self::default();
18712 __struct.ofs = buf.get_u32_le();
18713 __struct.id = buf.get_u16_le();
18714 __struct.count = buf.get_u8();
18715 for v in &mut __struct.data {
18716 let val = buf.get_u8();
18717 *v = val;
18718 }
18719 Ok(__struct)
18720 }
18721 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18722 let mut __tmp = BytesMut::new(bytes);
18723 #[allow(clippy::absurd_extreme_comparisons)]
18724 #[allow(unused_comparisons)]
18725 if __tmp.remaining() < Self::ENCODED_LEN {
18726 panic!(
18727 "buffer is too small (need {} bytes, but got {})",
18728 Self::ENCODED_LEN,
18729 __tmp.remaining(),
18730 )
18731 }
18732 __tmp.put_u32_le(self.ofs);
18733 __tmp.put_u16_le(self.id);
18734 __tmp.put_u8(self.count);
18735 for val in &self.data {
18736 __tmp.put_u8(*val);
18737 }
18738 if matches!(version, MavlinkVersion::V2) {
18739 let len = __tmp.len();
18740 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18741 } else {
18742 __tmp.len()
18743 }
18744 }
18745}
18746#[doc = "Reply to LOG_REQUEST_LIST."]
18747#[doc = ""]
18748#[doc = "ID: 118"]
18749#[derive(Debug, Clone, PartialEq)]
18750#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18751#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18752#[cfg_attr(feature = "ts", derive(TS))]
18753#[cfg_attr(feature = "ts", ts(export))]
18754pub struct LOG_ENTRY_DATA {
18755 #[doc = "UTC timestamp of log since 1970, or 0 if not available"]
18756 pub time_utc: u32,
18757 #[doc = "Size of the log (may be approximate)"]
18758 pub size: u32,
18759 #[doc = "Log id"]
18760 pub id: u16,
18761 #[doc = "Total number of logs"]
18762 pub num_logs: u16,
18763 #[doc = "High log number"]
18764 pub last_log_num: u16,
18765}
18766impl LOG_ENTRY_DATA {
18767 pub const ENCODED_LEN: usize = 14usize;
18768 pub const DEFAULT: Self = Self {
18769 time_utc: 0_u32,
18770 size: 0_u32,
18771 id: 0_u16,
18772 num_logs: 0_u16,
18773 last_log_num: 0_u16,
18774 };
18775 #[cfg(feature = "arbitrary")]
18776 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18777 use arbitrary::{Arbitrary, Unstructured};
18778 let mut buf = [0u8; 1024];
18779 rng.fill_bytes(&mut buf);
18780 let mut unstructured = Unstructured::new(&buf);
18781 Self::arbitrary(&mut unstructured).unwrap_or_default()
18782 }
18783}
18784impl Default for LOG_ENTRY_DATA {
18785 fn default() -> Self {
18786 Self::DEFAULT.clone()
18787 }
18788}
18789impl MessageData for LOG_ENTRY_DATA {
18790 type Message = MavMessage;
18791 const ID: u32 = 118u32;
18792 const NAME: &'static str = "LOG_ENTRY";
18793 const EXTRA_CRC: u8 = 56u8;
18794 const ENCODED_LEN: usize = 14usize;
18795 fn deser(
18796 _version: MavlinkVersion,
18797 __input: &[u8],
18798 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18799 let avail_len = __input.len();
18800 let mut payload_buf = [0; Self::ENCODED_LEN];
18801 let mut buf = if avail_len < Self::ENCODED_LEN {
18802 payload_buf[0..avail_len].copy_from_slice(__input);
18803 Bytes::new(&payload_buf)
18804 } else {
18805 Bytes::new(__input)
18806 };
18807 let mut __struct = Self::default();
18808 __struct.time_utc = buf.get_u32_le();
18809 __struct.size = buf.get_u32_le();
18810 __struct.id = buf.get_u16_le();
18811 __struct.num_logs = buf.get_u16_le();
18812 __struct.last_log_num = buf.get_u16_le();
18813 Ok(__struct)
18814 }
18815 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18816 let mut __tmp = BytesMut::new(bytes);
18817 #[allow(clippy::absurd_extreme_comparisons)]
18818 #[allow(unused_comparisons)]
18819 if __tmp.remaining() < Self::ENCODED_LEN {
18820 panic!(
18821 "buffer is too small (need {} bytes, but got {})",
18822 Self::ENCODED_LEN,
18823 __tmp.remaining(),
18824 )
18825 }
18826 __tmp.put_u32_le(self.time_utc);
18827 __tmp.put_u32_le(self.size);
18828 __tmp.put_u16_le(self.id);
18829 __tmp.put_u16_le(self.num_logs);
18830 __tmp.put_u16_le(self.last_log_num);
18831 if matches!(version, MavlinkVersion::V2) {
18832 let len = __tmp.len();
18833 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18834 } else {
18835 __tmp.len()
18836 }
18837 }
18838}
18839#[doc = "Erase all logs."]
18840#[doc = ""]
18841#[doc = "ID: 121"]
18842#[derive(Debug, Clone, PartialEq)]
18843#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18844#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18845#[cfg_attr(feature = "ts", derive(TS))]
18846#[cfg_attr(feature = "ts", ts(export))]
18847pub struct LOG_ERASE_DATA {
18848 #[doc = "System ID"]
18849 pub target_system: u8,
18850 #[doc = "Component ID"]
18851 pub target_component: u8,
18852}
18853impl LOG_ERASE_DATA {
18854 pub const ENCODED_LEN: usize = 2usize;
18855 pub const DEFAULT: Self = Self {
18856 target_system: 0_u8,
18857 target_component: 0_u8,
18858 };
18859 #[cfg(feature = "arbitrary")]
18860 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18861 use arbitrary::{Arbitrary, Unstructured};
18862 let mut buf = [0u8; 1024];
18863 rng.fill_bytes(&mut buf);
18864 let mut unstructured = Unstructured::new(&buf);
18865 Self::arbitrary(&mut unstructured).unwrap_or_default()
18866 }
18867}
18868impl Default for LOG_ERASE_DATA {
18869 fn default() -> Self {
18870 Self::DEFAULT.clone()
18871 }
18872}
18873impl MessageData for LOG_ERASE_DATA {
18874 type Message = MavMessage;
18875 const ID: u32 = 121u32;
18876 const NAME: &'static str = "LOG_ERASE";
18877 const EXTRA_CRC: u8 = 237u8;
18878 const ENCODED_LEN: usize = 2usize;
18879 fn deser(
18880 _version: MavlinkVersion,
18881 __input: &[u8],
18882 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18883 let avail_len = __input.len();
18884 let mut payload_buf = [0; Self::ENCODED_LEN];
18885 let mut buf = if avail_len < Self::ENCODED_LEN {
18886 payload_buf[0..avail_len].copy_from_slice(__input);
18887 Bytes::new(&payload_buf)
18888 } else {
18889 Bytes::new(__input)
18890 };
18891 let mut __struct = Self::default();
18892 __struct.target_system = buf.get_u8();
18893 __struct.target_component = buf.get_u8();
18894 Ok(__struct)
18895 }
18896 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18897 let mut __tmp = BytesMut::new(bytes);
18898 #[allow(clippy::absurd_extreme_comparisons)]
18899 #[allow(unused_comparisons)]
18900 if __tmp.remaining() < Self::ENCODED_LEN {
18901 panic!(
18902 "buffer is too small (need {} bytes, but got {})",
18903 Self::ENCODED_LEN,
18904 __tmp.remaining(),
18905 )
18906 }
18907 __tmp.put_u8(self.target_system);
18908 __tmp.put_u8(self.target_component);
18909 if matches!(version, MavlinkVersion::V2) {
18910 let len = __tmp.len();
18911 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18912 } else {
18913 __tmp.len()
18914 }
18915 }
18916}
18917#[doc = "Request a chunk of a log."]
18918#[doc = ""]
18919#[doc = "ID: 119"]
18920#[derive(Debug, Clone, PartialEq)]
18921#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18922#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18923#[cfg_attr(feature = "ts", derive(TS))]
18924#[cfg_attr(feature = "ts", ts(export))]
18925pub struct LOG_REQUEST_DATA_DATA {
18926 #[doc = "Offset into the log"]
18927 pub ofs: u32,
18928 #[doc = "Number of bytes"]
18929 pub count: u32,
18930 #[doc = "Log id (from LOG_ENTRY reply)"]
18931 pub id: u16,
18932 #[doc = "System ID"]
18933 pub target_system: u8,
18934 #[doc = "Component ID"]
18935 pub target_component: u8,
18936}
18937impl LOG_REQUEST_DATA_DATA {
18938 pub const ENCODED_LEN: usize = 12usize;
18939 pub const DEFAULT: Self = Self {
18940 ofs: 0_u32,
18941 count: 0_u32,
18942 id: 0_u16,
18943 target_system: 0_u8,
18944 target_component: 0_u8,
18945 };
18946 #[cfg(feature = "arbitrary")]
18947 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18948 use arbitrary::{Arbitrary, Unstructured};
18949 let mut buf = [0u8; 1024];
18950 rng.fill_bytes(&mut buf);
18951 let mut unstructured = Unstructured::new(&buf);
18952 Self::arbitrary(&mut unstructured).unwrap_or_default()
18953 }
18954}
18955impl Default for LOG_REQUEST_DATA_DATA {
18956 fn default() -> Self {
18957 Self::DEFAULT.clone()
18958 }
18959}
18960impl MessageData for LOG_REQUEST_DATA_DATA {
18961 type Message = MavMessage;
18962 const ID: u32 = 119u32;
18963 const NAME: &'static str = "LOG_REQUEST_DATA";
18964 const EXTRA_CRC: u8 = 116u8;
18965 const ENCODED_LEN: usize = 12usize;
18966 fn deser(
18967 _version: MavlinkVersion,
18968 __input: &[u8],
18969 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18970 let avail_len = __input.len();
18971 let mut payload_buf = [0; Self::ENCODED_LEN];
18972 let mut buf = if avail_len < Self::ENCODED_LEN {
18973 payload_buf[0..avail_len].copy_from_slice(__input);
18974 Bytes::new(&payload_buf)
18975 } else {
18976 Bytes::new(__input)
18977 };
18978 let mut __struct = Self::default();
18979 __struct.ofs = buf.get_u32_le();
18980 __struct.count = buf.get_u32_le();
18981 __struct.id = buf.get_u16_le();
18982 __struct.target_system = buf.get_u8();
18983 __struct.target_component = buf.get_u8();
18984 Ok(__struct)
18985 }
18986 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18987 let mut __tmp = BytesMut::new(bytes);
18988 #[allow(clippy::absurd_extreme_comparisons)]
18989 #[allow(unused_comparisons)]
18990 if __tmp.remaining() < Self::ENCODED_LEN {
18991 panic!(
18992 "buffer is too small (need {} bytes, but got {})",
18993 Self::ENCODED_LEN,
18994 __tmp.remaining(),
18995 )
18996 }
18997 __tmp.put_u32_le(self.ofs);
18998 __tmp.put_u32_le(self.count);
18999 __tmp.put_u16_le(self.id);
19000 __tmp.put_u8(self.target_system);
19001 __tmp.put_u8(self.target_component);
19002 if matches!(version, MavlinkVersion::V2) {
19003 let len = __tmp.len();
19004 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19005 } else {
19006 __tmp.len()
19007 }
19008 }
19009}
19010#[doc = "Stop log transfer and resume normal logging."]
19011#[doc = ""]
19012#[doc = "ID: 122"]
19013#[derive(Debug, Clone, PartialEq)]
19014#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19015#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19016#[cfg_attr(feature = "ts", derive(TS))]
19017#[cfg_attr(feature = "ts", ts(export))]
19018pub struct LOG_REQUEST_END_DATA {
19019 #[doc = "System ID"]
19020 pub target_system: u8,
19021 #[doc = "Component ID"]
19022 pub target_component: u8,
19023}
19024impl LOG_REQUEST_END_DATA {
19025 pub const ENCODED_LEN: usize = 2usize;
19026 pub const DEFAULT: Self = Self {
19027 target_system: 0_u8,
19028 target_component: 0_u8,
19029 };
19030 #[cfg(feature = "arbitrary")]
19031 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19032 use arbitrary::{Arbitrary, Unstructured};
19033 let mut buf = [0u8; 1024];
19034 rng.fill_bytes(&mut buf);
19035 let mut unstructured = Unstructured::new(&buf);
19036 Self::arbitrary(&mut unstructured).unwrap_or_default()
19037 }
19038}
19039impl Default for LOG_REQUEST_END_DATA {
19040 fn default() -> Self {
19041 Self::DEFAULT.clone()
19042 }
19043}
19044impl MessageData for LOG_REQUEST_END_DATA {
19045 type Message = MavMessage;
19046 const ID: u32 = 122u32;
19047 const NAME: &'static str = "LOG_REQUEST_END";
19048 const EXTRA_CRC: u8 = 203u8;
19049 const ENCODED_LEN: usize = 2usize;
19050 fn deser(
19051 _version: MavlinkVersion,
19052 __input: &[u8],
19053 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19054 let avail_len = __input.len();
19055 let mut payload_buf = [0; Self::ENCODED_LEN];
19056 let mut buf = if avail_len < Self::ENCODED_LEN {
19057 payload_buf[0..avail_len].copy_from_slice(__input);
19058 Bytes::new(&payload_buf)
19059 } else {
19060 Bytes::new(__input)
19061 };
19062 let mut __struct = Self::default();
19063 __struct.target_system = buf.get_u8();
19064 __struct.target_component = buf.get_u8();
19065 Ok(__struct)
19066 }
19067 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19068 let mut __tmp = BytesMut::new(bytes);
19069 #[allow(clippy::absurd_extreme_comparisons)]
19070 #[allow(unused_comparisons)]
19071 if __tmp.remaining() < Self::ENCODED_LEN {
19072 panic!(
19073 "buffer is too small (need {} bytes, but got {})",
19074 Self::ENCODED_LEN,
19075 __tmp.remaining(),
19076 )
19077 }
19078 __tmp.put_u8(self.target_system);
19079 __tmp.put_u8(self.target_component);
19080 if matches!(version, MavlinkVersion::V2) {
19081 let len = __tmp.len();
19082 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19083 } else {
19084 __tmp.len()
19085 }
19086 }
19087}
19088#[doc = "Request a list of available logs. On some systems calling this may stop on-board logging until LOG_REQUEST_END is called. If there are no log files available this request shall be answered with one LOG_ENTRY message with id = 0 and num_logs = 0."]
19089#[doc = ""]
19090#[doc = "ID: 117"]
19091#[derive(Debug, Clone, PartialEq)]
19092#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19093#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19094#[cfg_attr(feature = "ts", derive(TS))]
19095#[cfg_attr(feature = "ts", ts(export))]
19096pub struct LOG_REQUEST_LIST_DATA {
19097 #[doc = "First log id (0 for first available)"]
19098 pub start: u16,
19099 #[doc = "Last log id (0xffff for last available)"]
19100 pub end: u16,
19101 #[doc = "System ID"]
19102 pub target_system: u8,
19103 #[doc = "Component ID"]
19104 pub target_component: u8,
19105}
19106impl LOG_REQUEST_LIST_DATA {
19107 pub const ENCODED_LEN: usize = 6usize;
19108 pub const DEFAULT: Self = Self {
19109 start: 0_u16,
19110 end: 0_u16,
19111 target_system: 0_u8,
19112 target_component: 0_u8,
19113 };
19114 #[cfg(feature = "arbitrary")]
19115 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19116 use arbitrary::{Arbitrary, Unstructured};
19117 let mut buf = [0u8; 1024];
19118 rng.fill_bytes(&mut buf);
19119 let mut unstructured = Unstructured::new(&buf);
19120 Self::arbitrary(&mut unstructured).unwrap_or_default()
19121 }
19122}
19123impl Default for LOG_REQUEST_LIST_DATA {
19124 fn default() -> Self {
19125 Self::DEFAULT.clone()
19126 }
19127}
19128impl MessageData for LOG_REQUEST_LIST_DATA {
19129 type Message = MavMessage;
19130 const ID: u32 = 117u32;
19131 const NAME: &'static str = "LOG_REQUEST_LIST";
19132 const EXTRA_CRC: u8 = 128u8;
19133 const ENCODED_LEN: usize = 6usize;
19134 fn deser(
19135 _version: MavlinkVersion,
19136 __input: &[u8],
19137 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19138 let avail_len = __input.len();
19139 let mut payload_buf = [0; Self::ENCODED_LEN];
19140 let mut buf = if avail_len < Self::ENCODED_LEN {
19141 payload_buf[0..avail_len].copy_from_slice(__input);
19142 Bytes::new(&payload_buf)
19143 } else {
19144 Bytes::new(__input)
19145 };
19146 let mut __struct = Self::default();
19147 __struct.start = buf.get_u16_le();
19148 __struct.end = buf.get_u16_le();
19149 __struct.target_system = buf.get_u8();
19150 __struct.target_component = buf.get_u8();
19151 Ok(__struct)
19152 }
19153 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19154 let mut __tmp = BytesMut::new(bytes);
19155 #[allow(clippy::absurd_extreme_comparisons)]
19156 #[allow(unused_comparisons)]
19157 if __tmp.remaining() < Self::ENCODED_LEN {
19158 panic!(
19159 "buffer is too small (need {} bytes, but got {})",
19160 Self::ENCODED_LEN,
19161 __tmp.remaining(),
19162 )
19163 }
19164 __tmp.put_u16_le(self.start);
19165 __tmp.put_u16_le(self.end);
19166 __tmp.put_u8(self.target_system);
19167 __tmp.put_u8(self.target_component);
19168 if matches!(version, MavlinkVersion::V2) {
19169 let len = __tmp.len();
19170 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19171 } else {
19172 __tmp.len()
19173 }
19174 }
19175}
19176#[doc = "Reports results of completed compass calibration. Sent until MAG_CAL_ACK received."]
19177#[doc = ""]
19178#[doc = "ID: 192"]
19179#[derive(Debug, Clone, PartialEq)]
19180#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19181#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19182#[cfg_attr(feature = "ts", derive(TS))]
19183#[cfg_attr(feature = "ts", ts(export))]
19184pub struct MAG_CAL_REPORT_DATA {
19185 #[doc = "RMS milligauss residuals."]
19186 pub fitness: f32,
19187 #[doc = "X offset."]
19188 pub ofs_x: f32,
19189 #[doc = "Y offset."]
19190 pub ofs_y: f32,
19191 #[doc = "Z offset."]
19192 pub ofs_z: f32,
19193 #[doc = "X diagonal (matrix 11)."]
19194 pub diag_x: f32,
19195 #[doc = "Y diagonal (matrix 22)."]
19196 pub diag_y: f32,
19197 #[doc = "Z diagonal (matrix 33)."]
19198 pub diag_z: f32,
19199 #[doc = "X off-diagonal (matrix 12 and 21)."]
19200 pub offdiag_x: f32,
19201 #[doc = "Y off-diagonal (matrix 13 and 31)."]
19202 pub offdiag_y: f32,
19203 #[doc = "Z off-diagonal (matrix 32 and 23)."]
19204 pub offdiag_z: f32,
19205 #[doc = "Compass being calibrated."]
19206 pub compass_id: u8,
19207 #[doc = "Bitmask of compasses being calibrated."]
19208 pub cal_mask: u8,
19209 #[doc = "Calibration Status."]
19210 pub cal_status: MagCalStatus,
19211 #[doc = "0=requires a MAV_CMD_DO_ACCEPT_MAG_CAL, 1=saved to parameters."]
19212 pub autosaved: u8,
19213 #[doc = "Confidence in orientation (higher is better)."]
19214 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19215 pub orientation_confidence: f32,
19216 #[doc = "orientation before calibration."]
19217 #[cfg_attr(feature = "serde", serde(default))]
19218 pub old_orientation: MavSensorOrientation,
19219 #[doc = "orientation after calibration."]
19220 #[cfg_attr(feature = "serde", serde(default))]
19221 pub new_orientation: MavSensorOrientation,
19222 #[doc = "field radius correction factor"]
19223 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19224 pub scale_factor: f32,
19225}
19226impl MAG_CAL_REPORT_DATA {
19227 pub const ENCODED_LEN: usize = 54usize;
19228 pub const DEFAULT: Self = Self {
19229 fitness: 0.0_f32,
19230 ofs_x: 0.0_f32,
19231 ofs_y: 0.0_f32,
19232 ofs_z: 0.0_f32,
19233 diag_x: 0.0_f32,
19234 diag_y: 0.0_f32,
19235 diag_z: 0.0_f32,
19236 offdiag_x: 0.0_f32,
19237 offdiag_y: 0.0_f32,
19238 offdiag_z: 0.0_f32,
19239 compass_id: 0_u8,
19240 cal_mask: 0_u8,
19241 cal_status: MagCalStatus::DEFAULT,
19242 autosaved: 0_u8,
19243 orientation_confidence: 0.0_f32,
19244 old_orientation: MavSensorOrientation::DEFAULT,
19245 new_orientation: MavSensorOrientation::DEFAULT,
19246 scale_factor: 0.0_f32,
19247 };
19248 #[cfg(feature = "arbitrary")]
19249 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19250 use arbitrary::{Arbitrary, Unstructured};
19251 let mut buf = [0u8; 1024];
19252 rng.fill_bytes(&mut buf);
19253 let mut unstructured = Unstructured::new(&buf);
19254 Self::arbitrary(&mut unstructured).unwrap_or_default()
19255 }
19256}
19257impl Default for MAG_CAL_REPORT_DATA {
19258 fn default() -> Self {
19259 Self::DEFAULT.clone()
19260 }
19261}
19262impl MessageData for MAG_CAL_REPORT_DATA {
19263 type Message = MavMessage;
19264 const ID: u32 = 192u32;
19265 const NAME: &'static str = "MAG_CAL_REPORT";
19266 const EXTRA_CRC: u8 = 36u8;
19267 const ENCODED_LEN: usize = 54usize;
19268 fn deser(
19269 _version: MavlinkVersion,
19270 __input: &[u8],
19271 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19272 let avail_len = __input.len();
19273 let mut payload_buf = [0; Self::ENCODED_LEN];
19274 let mut buf = if avail_len < Self::ENCODED_LEN {
19275 payload_buf[0..avail_len].copy_from_slice(__input);
19276 Bytes::new(&payload_buf)
19277 } else {
19278 Bytes::new(__input)
19279 };
19280 let mut __struct = Self::default();
19281 __struct.fitness = buf.get_f32_le();
19282 __struct.ofs_x = buf.get_f32_le();
19283 __struct.ofs_y = buf.get_f32_le();
19284 __struct.ofs_z = buf.get_f32_le();
19285 __struct.diag_x = buf.get_f32_le();
19286 __struct.diag_y = buf.get_f32_le();
19287 __struct.diag_z = buf.get_f32_le();
19288 __struct.offdiag_x = buf.get_f32_le();
19289 __struct.offdiag_y = buf.get_f32_le();
19290 __struct.offdiag_z = buf.get_f32_le();
19291 __struct.compass_id = buf.get_u8();
19292 __struct.cal_mask = buf.get_u8();
19293 let tmp = buf.get_u8();
19294 __struct.cal_status =
19295 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19296 enum_type: "MagCalStatus",
19297 value: tmp as u32,
19298 })?;
19299 __struct.autosaved = buf.get_u8();
19300 __struct.orientation_confidence = buf.get_f32_le();
19301 let tmp = buf.get_u8();
19302 __struct.old_orientation =
19303 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19304 enum_type: "MavSensorOrientation",
19305 value: tmp as u32,
19306 })?;
19307 let tmp = buf.get_u8();
19308 __struct.new_orientation =
19309 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19310 enum_type: "MavSensorOrientation",
19311 value: tmp as u32,
19312 })?;
19313 __struct.scale_factor = buf.get_f32_le();
19314 Ok(__struct)
19315 }
19316 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19317 let mut __tmp = BytesMut::new(bytes);
19318 #[allow(clippy::absurd_extreme_comparisons)]
19319 #[allow(unused_comparisons)]
19320 if __tmp.remaining() < Self::ENCODED_LEN {
19321 panic!(
19322 "buffer is too small (need {} bytes, but got {})",
19323 Self::ENCODED_LEN,
19324 __tmp.remaining(),
19325 )
19326 }
19327 __tmp.put_f32_le(self.fitness);
19328 __tmp.put_f32_le(self.ofs_x);
19329 __tmp.put_f32_le(self.ofs_y);
19330 __tmp.put_f32_le(self.ofs_z);
19331 __tmp.put_f32_le(self.diag_x);
19332 __tmp.put_f32_le(self.diag_y);
19333 __tmp.put_f32_le(self.diag_z);
19334 __tmp.put_f32_le(self.offdiag_x);
19335 __tmp.put_f32_le(self.offdiag_y);
19336 __tmp.put_f32_le(self.offdiag_z);
19337 __tmp.put_u8(self.compass_id);
19338 __tmp.put_u8(self.cal_mask);
19339 __tmp.put_u8(self.cal_status as u8);
19340 __tmp.put_u8(self.autosaved);
19341 if matches!(version, MavlinkVersion::V2) {
19342 __tmp.put_f32_le(self.orientation_confidence);
19343 __tmp.put_u8(self.old_orientation as u8);
19344 __tmp.put_u8(self.new_orientation as u8);
19345 __tmp.put_f32_le(self.scale_factor);
19346 let len = __tmp.len();
19347 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19348 } else {
19349 __tmp.len()
19350 }
19351 }
19352}
19353#[doc = "This message provides an API for manually controlling the vehicle using standard joystick axes nomenclature, along with a joystick-like input device. Unused axes can be disabled and buttons states are transmitted as individual on/off bits of a bitmask."]
19354#[doc = ""]
19355#[doc = "ID: 69"]
19356#[derive(Debug, Clone, PartialEq)]
19357#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19358#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19359#[cfg_attr(feature = "ts", derive(TS))]
19360#[cfg_attr(feature = "ts", ts(export))]
19361pub struct MANUAL_CONTROL_DATA {
19362 #[doc = "X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle."]
19363 pub x: i16,
19364 #[doc = "Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle."]
19365 pub y: i16,
19366 #[doc = "Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle. Positive values are positive thrust, negative values are negative thrust."]
19367 pub z: i16,
19368 #[doc = "R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle."]
19369 pub r: i16,
19370 #[doc = "A bitfield corresponding to the joystick buttons' 0-15 current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1."]
19371 pub buttons: u16,
19372 #[doc = "The system to be controlled."]
19373 pub target: u8,
19374 #[doc = "A bitfield corresponding to the joystick buttons' 16-31 current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 16."]
19375 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19376 pub buttons2: u16,
19377 #[doc = "Set bits to 1 to indicate which of the following extension fields contain valid data: bit 0: pitch, bit 1: roll, bit 2: aux1, bit 3: aux2, bit 4: aux3, bit 5: aux4, bit 6: aux5, bit 7: aux6"]
19378 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19379 pub enabled_extensions: u8,
19380 #[doc = "Pitch-only-axis, normalized to the range [-1000,1000]. Generally corresponds to pitch on vehicles with additional degrees of freedom. Valid if bit 0 of enabled_extensions field is set. Set to 0 if invalid."]
19381 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19382 pub s: i16,
19383 #[doc = "Roll-only-axis, normalized to the range [-1000,1000]. Generally corresponds to roll on vehicles with additional degrees of freedom. Valid if bit 1 of enabled_extensions field is set. Set to 0 if invalid."]
19384 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19385 pub t: i16,
19386 #[doc = "Aux continuous input field 1. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 2 of enabled_extensions field is set. 0 if bit 2 is unset."]
19387 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19388 pub aux1: i16,
19389 #[doc = "Aux continuous input field 2. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 3 of enabled_extensions field is set. 0 if bit 3 is unset."]
19390 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19391 pub aux2: i16,
19392 #[doc = "Aux continuous input field 3. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 4 of enabled_extensions field is set. 0 if bit 4 is unset."]
19393 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19394 pub aux3: i16,
19395 #[doc = "Aux continuous input field 4. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 5 of enabled_extensions field is set. 0 if bit 5 is unset."]
19396 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19397 pub aux4: i16,
19398 #[doc = "Aux continuous input field 5. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 6 of enabled_extensions field is set. 0 if bit 6 is unset."]
19399 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19400 pub aux5: i16,
19401 #[doc = "Aux continuous input field 6. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 7 of enabled_extensions field is set. 0 if bit 7 is unset."]
19402 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19403 pub aux6: i16,
19404}
19405impl MANUAL_CONTROL_DATA {
19406 pub const ENCODED_LEN: usize = 30usize;
19407 pub const DEFAULT: Self = Self {
19408 x: 0_i16,
19409 y: 0_i16,
19410 z: 0_i16,
19411 r: 0_i16,
19412 buttons: 0_u16,
19413 target: 0_u8,
19414 buttons2: 0_u16,
19415 enabled_extensions: 0_u8,
19416 s: 0_i16,
19417 t: 0_i16,
19418 aux1: 0_i16,
19419 aux2: 0_i16,
19420 aux3: 0_i16,
19421 aux4: 0_i16,
19422 aux5: 0_i16,
19423 aux6: 0_i16,
19424 };
19425 #[cfg(feature = "arbitrary")]
19426 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19427 use arbitrary::{Arbitrary, Unstructured};
19428 let mut buf = [0u8; 1024];
19429 rng.fill_bytes(&mut buf);
19430 let mut unstructured = Unstructured::new(&buf);
19431 Self::arbitrary(&mut unstructured).unwrap_or_default()
19432 }
19433}
19434impl Default for MANUAL_CONTROL_DATA {
19435 fn default() -> Self {
19436 Self::DEFAULT.clone()
19437 }
19438}
19439impl MessageData for MANUAL_CONTROL_DATA {
19440 type Message = MavMessage;
19441 const ID: u32 = 69u32;
19442 const NAME: &'static str = "MANUAL_CONTROL";
19443 const EXTRA_CRC: u8 = 243u8;
19444 const ENCODED_LEN: usize = 30usize;
19445 fn deser(
19446 _version: MavlinkVersion,
19447 __input: &[u8],
19448 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19449 let avail_len = __input.len();
19450 let mut payload_buf = [0; Self::ENCODED_LEN];
19451 let mut buf = if avail_len < Self::ENCODED_LEN {
19452 payload_buf[0..avail_len].copy_from_slice(__input);
19453 Bytes::new(&payload_buf)
19454 } else {
19455 Bytes::new(__input)
19456 };
19457 let mut __struct = Self::default();
19458 __struct.x = buf.get_i16_le();
19459 __struct.y = buf.get_i16_le();
19460 __struct.z = buf.get_i16_le();
19461 __struct.r = buf.get_i16_le();
19462 __struct.buttons = buf.get_u16_le();
19463 __struct.target = buf.get_u8();
19464 __struct.buttons2 = buf.get_u16_le();
19465 __struct.enabled_extensions = buf.get_u8();
19466 __struct.s = buf.get_i16_le();
19467 __struct.t = buf.get_i16_le();
19468 __struct.aux1 = buf.get_i16_le();
19469 __struct.aux2 = buf.get_i16_le();
19470 __struct.aux3 = buf.get_i16_le();
19471 __struct.aux4 = buf.get_i16_le();
19472 __struct.aux5 = buf.get_i16_le();
19473 __struct.aux6 = buf.get_i16_le();
19474 Ok(__struct)
19475 }
19476 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19477 let mut __tmp = BytesMut::new(bytes);
19478 #[allow(clippy::absurd_extreme_comparisons)]
19479 #[allow(unused_comparisons)]
19480 if __tmp.remaining() < Self::ENCODED_LEN {
19481 panic!(
19482 "buffer is too small (need {} bytes, but got {})",
19483 Self::ENCODED_LEN,
19484 __tmp.remaining(),
19485 )
19486 }
19487 __tmp.put_i16_le(self.x);
19488 __tmp.put_i16_le(self.y);
19489 __tmp.put_i16_le(self.z);
19490 __tmp.put_i16_le(self.r);
19491 __tmp.put_u16_le(self.buttons);
19492 __tmp.put_u8(self.target);
19493 if matches!(version, MavlinkVersion::V2) {
19494 __tmp.put_u16_le(self.buttons2);
19495 __tmp.put_u8(self.enabled_extensions);
19496 __tmp.put_i16_le(self.s);
19497 __tmp.put_i16_le(self.t);
19498 __tmp.put_i16_le(self.aux1);
19499 __tmp.put_i16_le(self.aux2);
19500 __tmp.put_i16_le(self.aux3);
19501 __tmp.put_i16_le(self.aux4);
19502 __tmp.put_i16_le(self.aux5);
19503 __tmp.put_i16_le(self.aux6);
19504 let len = __tmp.len();
19505 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19506 } else {
19507 __tmp.len()
19508 }
19509 }
19510}
19511#[doc = "Setpoint in roll, pitch, yaw and thrust from the operator."]
19512#[doc = ""]
19513#[doc = "ID: 81"]
19514#[derive(Debug, Clone, PartialEq)]
19515#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19516#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19517#[cfg_attr(feature = "ts", derive(TS))]
19518#[cfg_attr(feature = "ts", ts(export))]
19519pub struct MANUAL_SETPOINT_DATA {
19520 #[doc = "Timestamp (time since system boot)."]
19521 pub time_boot_ms: u32,
19522 #[doc = "Desired roll rate"]
19523 pub roll: f32,
19524 #[doc = "Desired pitch rate"]
19525 pub pitch: f32,
19526 #[doc = "Desired yaw rate"]
19527 pub yaw: f32,
19528 #[doc = "Collective thrust, normalized to 0 .. 1"]
19529 pub thrust: f32,
19530 #[doc = "Flight mode switch position, 0.. 255"]
19531 pub mode_switch: u8,
19532 #[doc = "Override mode switch position, 0.. 255"]
19533 pub manual_override_switch: u8,
19534}
19535impl MANUAL_SETPOINT_DATA {
19536 pub const ENCODED_LEN: usize = 22usize;
19537 pub const DEFAULT: Self = Self {
19538 time_boot_ms: 0_u32,
19539 roll: 0.0_f32,
19540 pitch: 0.0_f32,
19541 yaw: 0.0_f32,
19542 thrust: 0.0_f32,
19543 mode_switch: 0_u8,
19544 manual_override_switch: 0_u8,
19545 };
19546 #[cfg(feature = "arbitrary")]
19547 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19548 use arbitrary::{Arbitrary, Unstructured};
19549 let mut buf = [0u8; 1024];
19550 rng.fill_bytes(&mut buf);
19551 let mut unstructured = Unstructured::new(&buf);
19552 Self::arbitrary(&mut unstructured).unwrap_or_default()
19553 }
19554}
19555impl Default for MANUAL_SETPOINT_DATA {
19556 fn default() -> Self {
19557 Self::DEFAULT.clone()
19558 }
19559}
19560impl MessageData for MANUAL_SETPOINT_DATA {
19561 type Message = MavMessage;
19562 const ID: u32 = 81u32;
19563 const NAME: &'static str = "MANUAL_SETPOINT";
19564 const EXTRA_CRC: u8 = 106u8;
19565 const ENCODED_LEN: usize = 22usize;
19566 fn deser(
19567 _version: MavlinkVersion,
19568 __input: &[u8],
19569 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19570 let avail_len = __input.len();
19571 let mut payload_buf = [0; Self::ENCODED_LEN];
19572 let mut buf = if avail_len < Self::ENCODED_LEN {
19573 payload_buf[0..avail_len].copy_from_slice(__input);
19574 Bytes::new(&payload_buf)
19575 } else {
19576 Bytes::new(__input)
19577 };
19578 let mut __struct = Self::default();
19579 __struct.time_boot_ms = buf.get_u32_le();
19580 __struct.roll = buf.get_f32_le();
19581 __struct.pitch = buf.get_f32_le();
19582 __struct.yaw = buf.get_f32_le();
19583 __struct.thrust = buf.get_f32_le();
19584 __struct.mode_switch = buf.get_u8();
19585 __struct.manual_override_switch = buf.get_u8();
19586 Ok(__struct)
19587 }
19588 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19589 let mut __tmp = BytesMut::new(bytes);
19590 #[allow(clippy::absurd_extreme_comparisons)]
19591 #[allow(unused_comparisons)]
19592 if __tmp.remaining() < Self::ENCODED_LEN {
19593 panic!(
19594 "buffer is too small (need {} bytes, but got {})",
19595 Self::ENCODED_LEN,
19596 __tmp.remaining(),
19597 )
19598 }
19599 __tmp.put_u32_le(self.time_boot_ms);
19600 __tmp.put_f32_le(self.roll);
19601 __tmp.put_f32_le(self.pitch);
19602 __tmp.put_f32_le(self.yaw);
19603 __tmp.put_f32_le(self.thrust);
19604 __tmp.put_u8(self.mode_switch);
19605 __tmp.put_u8(self.manual_override_switch);
19606 if matches!(version, MavlinkVersion::V2) {
19607 let len = __tmp.len();
19608 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19609 } else {
19610 __tmp.len()
19611 }
19612 }
19613}
19614#[doc = "Send raw controller memory. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
19615#[doc = ""]
19616#[doc = "ID: 249"]
19617#[derive(Debug, Clone, PartialEq)]
19618#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19619#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19620#[cfg_attr(feature = "ts", derive(TS))]
19621#[cfg_attr(feature = "ts", ts(export))]
19622pub struct MEMORY_VECT_DATA {
19623 #[doc = "Starting address of the debug variables"]
19624 pub address: u16,
19625 #[doc = "Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below"]
19626 pub ver: u8,
19627 #[doc = "Type code of the memory variables. for ver = 1: 0=16 x int16_t, 1=16 x uint16_t, 2=16 x Q15, 3=16 x 1Q14"]
19628 pub mavtype: u8,
19629 #[doc = "Memory contents at specified address"]
19630 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
19631 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
19632 pub value: [i8; 32],
19633}
19634impl MEMORY_VECT_DATA {
19635 pub const ENCODED_LEN: usize = 36usize;
19636 pub const DEFAULT: Self = Self {
19637 address: 0_u16,
19638 ver: 0_u8,
19639 mavtype: 0_u8,
19640 value: [0_i8; 32usize],
19641 };
19642 #[cfg(feature = "arbitrary")]
19643 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19644 use arbitrary::{Arbitrary, Unstructured};
19645 let mut buf = [0u8; 1024];
19646 rng.fill_bytes(&mut buf);
19647 let mut unstructured = Unstructured::new(&buf);
19648 Self::arbitrary(&mut unstructured).unwrap_or_default()
19649 }
19650}
19651impl Default for MEMORY_VECT_DATA {
19652 fn default() -> Self {
19653 Self::DEFAULT.clone()
19654 }
19655}
19656impl MessageData for MEMORY_VECT_DATA {
19657 type Message = MavMessage;
19658 const ID: u32 = 249u32;
19659 const NAME: &'static str = "MEMORY_VECT";
19660 const EXTRA_CRC: u8 = 204u8;
19661 const ENCODED_LEN: usize = 36usize;
19662 fn deser(
19663 _version: MavlinkVersion,
19664 __input: &[u8],
19665 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19666 let avail_len = __input.len();
19667 let mut payload_buf = [0; Self::ENCODED_LEN];
19668 let mut buf = if avail_len < Self::ENCODED_LEN {
19669 payload_buf[0..avail_len].copy_from_slice(__input);
19670 Bytes::new(&payload_buf)
19671 } else {
19672 Bytes::new(__input)
19673 };
19674 let mut __struct = Self::default();
19675 __struct.address = buf.get_u16_le();
19676 __struct.ver = buf.get_u8();
19677 __struct.mavtype = buf.get_u8();
19678 for v in &mut __struct.value {
19679 let val = buf.get_i8();
19680 *v = val;
19681 }
19682 Ok(__struct)
19683 }
19684 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19685 let mut __tmp = BytesMut::new(bytes);
19686 #[allow(clippy::absurd_extreme_comparisons)]
19687 #[allow(unused_comparisons)]
19688 if __tmp.remaining() < Self::ENCODED_LEN {
19689 panic!(
19690 "buffer is too small (need {} bytes, but got {})",
19691 Self::ENCODED_LEN,
19692 __tmp.remaining(),
19693 )
19694 }
19695 __tmp.put_u16_le(self.address);
19696 __tmp.put_u8(self.ver);
19697 __tmp.put_u8(self.mavtype);
19698 for val in &self.value {
19699 __tmp.put_i8(*val);
19700 }
19701 if matches!(version, MavlinkVersion::V2) {
19702 let len = __tmp.len();
19703 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19704 } else {
19705 __tmp.len()
19706 }
19707 }
19708}
19709#[doc = "The interval between messages for a particular MAVLink message ID. This message is sent in response to the MAV_CMD_REQUEST_MESSAGE command with param1=244 (this message) and param2=message_id (the id of the message for which the interval is required). \tIt may also be sent in response to MAV_CMD_GET_MESSAGE_INTERVAL. \tThis interface replaces DATA_STREAM."]
19710#[doc = ""]
19711#[doc = "ID: 244"]
19712#[derive(Debug, Clone, PartialEq)]
19713#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19714#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19715#[cfg_attr(feature = "ts", derive(TS))]
19716#[cfg_attr(feature = "ts", ts(export))]
19717pub struct MESSAGE_INTERVAL_DATA {
19718 #[doc = "0 indicates the interval at which it is sent."]
19719 pub interval_us: i32,
19720 #[doc = "The ID of the requested MAVLink message. v1.0 is limited to 254 messages."]
19721 pub message_id: u16,
19722}
19723impl MESSAGE_INTERVAL_DATA {
19724 pub const ENCODED_LEN: usize = 6usize;
19725 pub const DEFAULT: Self = Self {
19726 interval_us: 0_i32,
19727 message_id: 0_u16,
19728 };
19729 #[cfg(feature = "arbitrary")]
19730 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19731 use arbitrary::{Arbitrary, Unstructured};
19732 let mut buf = [0u8; 1024];
19733 rng.fill_bytes(&mut buf);
19734 let mut unstructured = Unstructured::new(&buf);
19735 Self::arbitrary(&mut unstructured).unwrap_or_default()
19736 }
19737}
19738impl Default for MESSAGE_INTERVAL_DATA {
19739 fn default() -> Self {
19740 Self::DEFAULT.clone()
19741 }
19742}
19743impl MessageData for MESSAGE_INTERVAL_DATA {
19744 type Message = MavMessage;
19745 const ID: u32 = 244u32;
19746 const NAME: &'static str = "MESSAGE_INTERVAL";
19747 const EXTRA_CRC: u8 = 95u8;
19748 const ENCODED_LEN: usize = 6usize;
19749 fn deser(
19750 _version: MavlinkVersion,
19751 __input: &[u8],
19752 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19753 let avail_len = __input.len();
19754 let mut payload_buf = [0; Self::ENCODED_LEN];
19755 let mut buf = if avail_len < Self::ENCODED_LEN {
19756 payload_buf[0..avail_len].copy_from_slice(__input);
19757 Bytes::new(&payload_buf)
19758 } else {
19759 Bytes::new(__input)
19760 };
19761 let mut __struct = Self::default();
19762 __struct.interval_us = buf.get_i32_le();
19763 __struct.message_id = buf.get_u16_le();
19764 Ok(__struct)
19765 }
19766 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19767 let mut __tmp = BytesMut::new(bytes);
19768 #[allow(clippy::absurd_extreme_comparisons)]
19769 #[allow(unused_comparisons)]
19770 if __tmp.remaining() < Self::ENCODED_LEN {
19771 panic!(
19772 "buffer is too small (need {} bytes, but got {})",
19773 Self::ENCODED_LEN,
19774 __tmp.remaining(),
19775 )
19776 }
19777 __tmp.put_i32_le(self.interval_us);
19778 __tmp.put_u16_le(self.message_id);
19779 if matches!(version, MavlinkVersion::V2) {
19780 let len = __tmp.len();
19781 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19782 } else {
19783 __tmp.len()
19784 }
19785 }
19786}
19787#[doc = "Acknowledgment message during waypoint handling. The type field states if this message is a positive ack (type=0) or if an error happened (type=non-zero)."]
19788#[doc = ""]
19789#[doc = "ID: 47"]
19790#[derive(Debug, Clone, PartialEq)]
19791#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19792#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19793#[cfg_attr(feature = "ts", derive(TS))]
19794#[cfg_attr(feature = "ts", ts(export))]
19795pub struct MISSION_ACK_DATA {
19796 #[doc = "System ID"]
19797 pub target_system: u8,
19798 #[doc = "Component ID"]
19799 pub target_component: u8,
19800 #[doc = "Mission result."]
19801 pub mavtype: MavMissionResult,
19802 #[doc = "Mission type."]
19803 #[cfg_attr(feature = "serde", serde(default))]
19804 pub mission_type: MavMissionType,
19805 #[doc = "Id of new on-vehicle mission, fence, or rally point plan (on upload to vehicle). The id is calculated and returned by a vehicle when a new plan is uploaded by a GCS. The only requirement on the id is that it must change when there is any change to the on-vehicle plan type (there is no requirement that the id be globally unique). 0 on download from the vehicle to the GCS (on download the ID is set in MISSION_COUNT). 0 if plan ids are not supported. The current on-vehicle plan ids are streamed in `MISSION_CURRENT`, allowing a GCS to determine if any part of the plan has changed and needs to be re-uploaded."]
19806 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19807 pub opaque_id: u32,
19808}
19809impl MISSION_ACK_DATA {
19810 pub const ENCODED_LEN: usize = 8usize;
19811 pub const DEFAULT: Self = Self {
19812 target_system: 0_u8,
19813 target_component: 0_u8,
19814 mavtype: MavMissionResult::DEFAULT,
19815 mission_type: MavMissionType::DEFAULT,
19816 opaque_id: 0_u32,
19817 };
19818 #[cfg(feature = "arbitrary")]
19819 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19820 use arbitrary::{Arbitrary, Unstructured};
19821 let mut buf = [0u8; 1024];
19822 rng.fill_bytes(&mut buf);
19823 let mut unstructured = Unstructured::new(&buf);
19824 Self::arbitrary(&mut unstructured).unwrap_or_default()
19825 }
19826}
19827impl Default for MISSION_ACK_DATA {
19828 fn default() -> Self {
19829 Self::DEFAULT.clone()
19830 }
19831}
19832impl MessageData for MISSION_ACK_DATA {
19833 type Message = MavMessage;
19834 const ID: u32 = 47u32;
19835 const NAME: &'static str = "MISSION_ACK";
19836 const EXTRA_CRC: u8 = 153u8;
19837 const ENCODED_LEN: usize = 8usize;
19838 fn deser(
19839 _version: MavlinkVersion,
19840 __input: &[u8],
19841 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19842 let avail_len = __input.len();
19843 let mut payload_buf = [0; Self::ENCODED_LEN];
19844 let mut buf = if avail_len < Self::ENCODED_LEN {
19845 payload_buf[0..avail_len].copy_from_slice(__input);
19846 Bytes::new(&payload_buf)
19847 } else {
19848 Bytes::new(__input)
19849 };
19850 let mut __struct = Self::default();
19851 __struct.target_system = buf.get_u8();
19852 __struct.target_component = buf.get_u8();
19853 let tmp = buf.get_u8();
19854 __struct.mavtype =
19855 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19856 enum_type: "MavMissionResult",
19857 value: tmp as u32,
19858 })?;
19859 let tmp = buf.get_u8();
19860 __struct.mission_type =
19861 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19862 enum_type: "MavMissionType",
19863 value: tmp as u32,
19864 })?;
19865 __struct.opaque_id = buf.get_u32_le();
19866 Ok(__struct)
19867 }
19868 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19869 let mut __tmp = BytesMut::new(bytes);
19870 #[allow(clippy::absurd_extreme_comparisons)]
19871 #[allow(unused_comparisons)]
19872 if __tmp.remaining() < Self::ENCODED_LEN {
19873 panic!(
19874 "buffer is too small (need {} bytes, but got {})",
19875 Self::ENCODED_LEN,
19876 __tmp.remaining(),
19877 )
19878 }
19879 __tmp.put_u8(self.target_system);
19880 __tmp.put_u8(self.target_component);
19881 __tmp.put_u8(self.mavtype as u8);
19882 if matches!(version, MavlinkVersion::V2) {
19883 __tmp.put_u8(self.mission_type as u8);
19884 __tmp.put_u32_le(self.opaque_id);
19885 let len = __tmp.len();
19886 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19887 } else {
19888 __tmp.len()
19889 }
19890 }
19891}
19892#[doc = "Delete all mission items at once."]
19893#[doc = ""]
19894#[doc = "ID: 45"]
19895#[derive(Debug, Clone, PartialEq)]
19896#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19897#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19898#[cfg_attr(feature = "ts", derive(TS))]
19899#[cfg_attr(feature = "ts", ts(export))]
19900pub struct MISSION_CLEAR_ALL_DATA {
19901 #[doc = "System ID"]
19902 pub target_system: u8,
19903 #[doc = "Component ID"]
19904 pub target_component: u8,
19905 #[doc = "Mission type."]
19906 #[cfg_attr(feature = "serde", serde(default))]
19907 pub mission_type: MavMissionType,
19908}
19909impl MISSION_CLEAR_ALL_DATA {
19910 pub const ENCODED_LEN: usize = 3usize;
19911 pub const DEFAULT: Self = Self {
19912 target_system: 0_u8,
19913 target_component: 0_u8,
19914 mission_type: MavMissionType::DEFAULT,
19915 };
19916 #[cfg(feature = "arbitrary")]
19917 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19918 use arbitrary::{Arbitrary, Unstructured};
19919 let mut buf = [0u8; 1024];
19920 rng.fill_bytes(&mut buf);
19921 let mut unstructured = Unstructured::new(&buf);
19922 Self::arbitrary(&mut unstructured).unwrap_or_default()
19923 }
19924}
19925impl Default for MISSION_CLEAR_ALL_DATA {
19926 fn default() -> Self {
19927 Self::DEFAULT.clone()
19928 }
19929}
19930impl MessageData for MISSION_CLEAR_ALL_DATA {
19931 type Message = MavMessage;
19932 const ID: u32 = 45u32;
19933 const NAME: &'static str = "MISSION_CLEAR_ALL";
19934 const EXTRA_CRC: u8 = 232u8;
19935 const ENCODED_LEN: usize = 3usize;
19936 fn deser(
19937 _version: MavlinkVersion,
19938 __input: &[u8],
19939 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19940 let avail_len = __input.len();
19941 let mut payload_buf = [0; Self::ENCODED_LEN];
19942 let mut buf = if avail_len < Self::ENCODED_LEN {
19943 payload_buf[0..avail_len].copy_from_slice(__input);
19944 Bytes::new(&payload_buf)
19945 } else {
19946 Bytes::new(__input)
19947 };
19948 let mut __struct = Self::default();
19949 __struct.target_system = buf.get_u8();
19950 __struct.target_component = buf.get_u8();
19951 let tmp = buf.get_u8();
19952 __struct.mission_type =
19953 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19954 enum_type: "MavMissionType",
19955 value: tmp as u32,
19956 })?;
19957 Ok(__struct)
19958 }
19959 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19960 let mut __tmp = BytesMut::new(bytes);
19961 #[allow(clippy::absurd_extreme_comparisons)]
19962 #[allow(unused_comparisons)]
19963 if __tmp.remaining() < Self::ENCODED_LEN {
19964 panic!(
19965 "buffer is too small (need {} bytes, but got {})",
19966 Self::ENCODED_LEN,
19967 __tmp.remaining(),
19968 )
19969 }
19970 __tmp.put_u8(self.target_system);
19971 __tmp.put_u8(self.target_component);
19972 if matches!(version, MavlinkVersion::V2) {
19973 __tmp.put_u8(self.mission_type as u8);
19974 let len = __tmp.len();
19975 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19976 } else {
19977 __tmp.len()
19978 }
19979 }
19980}
19981#[doc = "This message is emitted as response to MISSION_REQUEST_LIST by the MAV and to initiate a write transaction. The GCS can then request the individual mission item based on the knowledge of the total number of waypoints."]
19982#[doc = ""]
19983#[doc = "ID: 44"]
19984#[derive(Debug, Clone, PartialEq)]
19985#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19986#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19987#[cfg_attr(feature = "ts", derive(TS))]
19988#[cfg_attr(feature = "ts", ts(export))]
19989pub struct MISSION_COUNT_DATA {
19990 #[doc = "Number of mission items in the sequence"]
19991 pub count: u16,
19992 #[doc = "System ID"]
19993 pub target_system: u8,
19994 #[doc = "Component ID"]
19995 pub target_component: u8,
19996 #[doc = "Mission type."]
19997 #[cfg_attr(feature = "serde", serde(default))]
19998 pub mission_type: MavMissionType,
19999 #[doc = "Id of current on-vehicle mission, fence, or rally point plan (on download from vehicle). This field is used when downloading a plan from a vehicle to a GCS. 0 on upload to the vehicle from GCS. 0 if plan ids are not supported. The current on-vehicle plan ids are streamed in `MISSION_CURRENT`, allowing a GCS to determine if any part of the plan has changed and needs to be re-uploaded. The ids are recalculated by the vehicle when any part of the on-vehicle plan changes (when a new plan is uploaded, the vehicle returns the new id to the GCS in MISSION_ACK)."]
20000 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20001 pub opaque_id: u32,
20002}
20003impl MISSION_COUNT_DATA {
20004 pub const ENCODED_LEN: usize = 9usize;
20005 pub const DEFAULT: Self = Self {
20006 count: 0_u16,
20007 target_system: 0_u8,
20008 target_component: 0_u8,
20009 mission_type: MavMissionType::DEFAULT,
20010 opaque_id: 0_u32,
20011 };
20012 #[cfg(feature = "arbitrary")]
20013 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20014 use arbitrary::{Arbitrary, Unstructured};
20015 let mut buf = [0u8; 1024];
20016 rng.fill_bytes(&mut buf);
20017 let mut unstructured = Unstructured::new(&buf);
20018 Self::arbitrary(&mut unstructured).unwrap_or_default()
20019 }
20020}
20021impl Default for MISSION_COUNT_DATA {
20022 fn default() -> Self {
20023 Self::DEFAULT.clone()
20024 }
20025}
20026impl MessageData for MISSION_COUNT_DATA {
20027 type Message = MavMessage;
20028 const ID: u32 = 44u32;
20029 const NAME: &'static str = "MISSION_COUNT";
20030 const EXTRA_CRC: u8 = 221u8;
20031 const ENCODED_LEN: usize = 9usize;
20032 fn deser(
20033 _version: MavlinkVersion,
20034 __input: &[u8],
20035 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20036 let avail_len = __input.len();
20037 let mut payload_buf = [0; Self::ENCODED_LEN];
20038 let mut buf = if avail_len < Self::ENCODED_LEN {
20039 payload_buf[0..avail_len].copy_from_slice(__input);
20040 Bytes::new(&payload_buf)
20041 } else {
20042 Bytes::new(__input)
20043 };
20044 let mut __struct = Self::default();
20045 __struct.count = buf.get_u16_le();
20046 __struct.target_system = buf.get_u8();
20047 __struct.target_component = buf.get_u8();
20048 let tmp = buf.get_u8();
20049 __struct.mission_type =
20050 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20051 enum_type: "MavMissionType",
20052 value: tmp as u32,
20053 })?;
20054 __struct.opaque_id = buf.get_u32_le();
20055 Ok(__struct)
20056 }
20057 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20058 let mut __tmp = BytesMut::new(bytes);
20059 #[allow(clippy::absurd_extreme_comparisons)]
20060 #[allow(unused_comparisons)]
20061 if __tmp.remaining() < Self::ENCODED_LEN {
20062 panic!(
20063 "buffer is too small (need {} bytes, but got {})",
20064 Self::ENCODED_LEN,
20065 __tmp.remaining(),
20066 )
20067 }
20068 __tmp.put_u16_le(self.count);
20069 __tmp.put_u8(self.target_system);
20070 __tmp.put_u8(self.target_component);
20071 if matches!(version, MavlinkVersion::V2) {
20072 __tmp.put_u8(self.mission_type as u8);
20073 __tmp.put_u32_le(self.opaque_id);
20074 let len = __tmp.len();
20075 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20076 } else {
20077 __tmp.len()
20078 }
20079 }
20080}
20081#[doc = "Message that announces the sequence number of the current target mission item (that the system will fly towards/execute when the mission is running). This message should be streamed all the time (nominally at 1Hz). This message should be emitted following a call to MAV_CMD_DO_SET_MISSION_CURRENT or MISSION_SET_CURRENT."]
20082#[doc = ""]
20083#[doc = "ID: 42"]
20084#[derive(Debug, Clone, PartialEq)]
20085#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20086#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20087#[cfg_attr(feature = "ts", derive(TS))]
20088#[cfg_attr(feature = "ts", ts(export))]
20089pub struct MISSION_CURRENT_DATA {
20090 #[doc = "Sequence"]
20091 pub seq: u16,
20092 #[doc = "Total number of mission items on vehicle (on last item, sequence == total). If the autopilot stores its home location as part of the mission this will be excluded from the total. 0: Not supported, UINT16_MAX if no mission is present on the vehicle."]
20093 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20094 pub total: u16,
20095 #[doc = "Mission state machine state. MISSION_STATE_UNKNOWN if state reporting not supported."]
20096 #[cfg_attr(feature = "serde", serde(default))]
20097 pub mission_state: MissionState,
20098 #[doc = "Vehicle is in a mode that can execute mission items or suspended. 0: Unknown, 1: In mission mode, 2: Suspended (not in mission mode)."]
20099 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20100 pub mission_mode: u8,
20101 #[doc = "Id of current on-vehicle mission plan, or 0 if IDs are not supported or there is no mission loaded. GCS can use this to track changes to the mission plan type. The same value is returned on mission upload (in the MISSION_ACK)."]
20102 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20103 pub mission_id: u32,
20104 #[doc = "Id of current on-vehicle fence plan, or 0 if IDs are not supported or there is no fence loaded. GCS can use this to track changes to the fence plan type. The same value is returned on fence upload (in the MISSION_ACK)."]
20105 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20106 pub fence_id: u32,
20107 #[doc = "Id of current on-vehicle rally point plan, or 0 if IDs are not supported or there are no rally points loaded. GCS can use this to track changes to the rally point plan type. The same value is returned on rally point upload (in the MISSION_ACK)."]
20108 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20109 pub rally_points_id: u32,
20110}
20111impl MISSION_CURRENT_DATA {
20112 pub const ENCODED_LEN: usize = 18usize;
20113 pub const DEFAULT: Self = Self {
20114 seq: 0_u16,
20115 total: 0_u16,
20116 mission_state: MissionState::DEFAULT,
20117 mission_mode: 0_u8,
20118 mission_id: 0_u32,
20119 fence_id: 0_u32,
20120 rally_points_id: 0_u32,
20121 };
20122 #[cfg(feature = "arbitrary")]
20123 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20124 use arbitrary::{Arbitrary, Unstructured};
20125 let mut buf = [0u8; 1024];
20126 rng.fill_bytes(&mut buf);
20127 let mut unstructured = Unstructured::new(&buf);
20128 Self::arbitrary(&mut unstructured).unwrap_or_default()
20129 }
20130}
20131impl Default for MISSION_CURRENT_DATA {
20132 fn default() -> Self {
20133 Self::DEFAULT.clone()
20134 }
20135}
20136impl MessageData for MISSION_CURRENT_DATA {
20137 type Message = MavMessage;
20138 const ID: u32 = 42u32;
20139 const NAME: &'static str = "MISSION_CURRENT";
20140 const EXTRA_CRC: u8 = 28u8;
20141 const ENCODED_LEN: usize = 18usize;
20142 fn deser(
20143 _version: MavlinkVersion,
20144 __input: &[u8],
20145 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20146 let avail_len = __input.len();
20147 let mut payload_buf = [0; Self::ENCODED_LEN];
20148 let mut buf = if avail_len < Self::ENCODED_LEN {
20149 payload_buf[0..avail_len].copy_from_slice(__input);
20150 Bytes::new(&payload_buf)
20151 } else {
20152 Bytes::new(__input)
20153 };
20154 let mut __struct = Self::default();
20155 __struct.seq = buf.get_u16_le();
20156 __struct.total = buf.get_u16_le();
20157 let tmp = buf.get_u8();
20158 __struct.mission_state =
20159 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20160 enum_type: "MissionState",
20161 value: tmp as u32,
20162 })?;
20163 __struct.mission_mode = buf.get_u8();
20164 __struct.mission_id = buf.get_u32_le();
20165 __struct.fence_id = buf.get_u32_le();
20166 __struct.rally_points_id = buf.get_u32_le();
20167 Ok(__struct)
20168 }
20169 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20170 let mut __tmp = BytesMut::new(bytes);
20171 #[allow(clippy::absurd_extreme_comparisons)]
20172 #[allow(unused_comparisons)]
20173 if __tmp.remaining() < Self::ENCODED_LEN {
20174 panic!(
20175 "buffer is too small (need {} bytes, but got {})",
20176 Self::ENCODED_LEN,
20177 __tmp.remaining(),
20178 )
20179 }
20180 __tmp.put_u16_le(self.seq);
20181 if matches!(version, MavlinkVersion::V2) {
20182 __tmp.put_u16_le(self.total);
20183 __tmp.put_u8(self.mission_state as u8);
20184 __tmp.put_u8(self.mission_mode);
20185 __tmp.put_u32_le(self.mission_id);
20186 __tmp.put_u32_le(self.fence_id);
20187 __tmp.put_u32_le(self.rally_points_id);
20188 let len = __tmp.len();
20189 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20190 } else {
20191 __tmp.len()
20192 }
20193 }
20194}
20195#[deprecated = " See `MISSION_ITEM_INT` (Deprecated since 2020-06)"]
20196#[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN may be used to indicate an optional/default value (e.g. to use the system's current latitude or yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
20197#[doc = ""]
20198#[doc = "ID: 39"]
20199#[derive(Debug, Clone, PartialEq)]
20200#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20201#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20202#[cfg_attr(feature = "ts", derive(TS))]
20203#[cfg_attr(feature = "ts", ts(export))]
20204pub struct MISSION_ITEM_DATA {
20205 #[doc = "PARAM1, see MAV_CMD enum"]
20206 pub param1: f32,
20207 #[doc = "PARAM2, see MAV_CMD enum"]
20208 pub param2: f32,
20209 #[doc = "PARAM3, see MAV_CMD enum"]
20210 pub param3: f32,
20211 #[doc = "PARAM4, see MAV_CMD enum"]
20212 pub param4: f32,
20213 #[doc = "PARAM5 / local: X coordinate, global: latitude"]
20214 pub x: f32,
20215 #[doc = "PARAM6 / local: Y coordinate, global: longitude"]
20216 pub y: f32,
20217 #[doc = "PARAM7 / local: Z coordinate, global: altitude (relative or absolute, depending on frame)."]
20218 pub z: f32,
20219 #[doc = "Sequence"]
20220 pub seq: u16,
20221 #[doc = "The scheduled action for the waypoint."]
20222 pub command: MavCmd,
20223 #[doc = "System ID"]
20224 pub target_system: u8,
20225 #[doc = "Component ID"]
20226 pub target_component: u8,
20227 #[doc = "The coordinate system of the waypoint."]
20228 pub frame: MavFrame,
20229 #[doc = "false:0, true:1"]
20230 pub current: u8,
20231 #[doc = "Autocontinue to next waypoint. 0: false, 1: true. Set false to pause mission after the item completes."]
20232 pub autocontinue: u8,
20233 #[doc = "Mission type."]
20234 #[cfg_attr(feature = "serde", serde(default))]
20235 pub mission_type: MavMissionType,
20236}
20237impl MISSION_ITEM_DATA {
20238 pub const ENCODED_LEN: usize = 38usize;
20239 pub const DEFAULT: Self = Self {
20240 param1: 0.0_f32,
20241 param2: 0.0_f32,
20242 param3: 0.0_f32,
20243 param4: 0.0_f32,
20244 x: 0.0_f32,
20245 y: 0.0_f32,
20246 z: 0.0_f32,
20247 seq: 0_u16,
20248 command: MavCmd::DEFAULT,
20249 target_system: 0_u8,
20250 target_component: 0_u8,
20251 frame: MavFrame::DEFAULT,
20252 current: 0_u8,
20253 autocontinue: 0_u8,
20254 mission_type: MavMissionType::DEFAULT,
20255 };
20256 #[cfg(feature = "arbitrary")]
20257 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20258 use arbitrary::{Arbitrary, Unstructured};
20259 let mut buf = [0u8; 1024];
20260 rng.fill_bytes(&mut buf);
20261 let mut unstructured = Unstructured::new(&buf);
20262 Self::arbitrary(&mut unstructured).unwrap_or_default()
20263 }
20264}
20265impl Default for MISSION_ITEM_DATA {
20266 fn default() -> Self {
20267 Self::DEFAULT.clone()
20268 }
20269}
20270impl MessageData for MISSION_ITEM_DATA {
20271 type Message = MavMessage;
20272 const ID: u32 = 39u32;
20273 const NAME: &'static str = "MISSION_ITEM";
20274 const EXTRA_CRC: u8 = 254u8;
20275 const ENCODED_LEN: usize = 38usize;
20276 fn deser(
20277 _version: MavlinkVersion,
20278 __input: &[u8],
20279 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20280 let avail_len = __input.len();
20281 let mut payload_buf = [0; Self::ENCODED_LEN];
20282 let mut buf = if avail_len < Self::ENCODED_LEN {
20283 payload_buf[0..avail_len].copy_from_slice(__input);
20284 Bytes::new(&payload_buf)
20285 } else {
20286 Bytes::new(__input)
20287 };
20288 let mut __struct = Self::default();
20289 __struct.param1 = buf.get_f32_le();
20290 __struct.param2 = buf.get_f32_le();
20291 __struct.param3 = buf.get_f32_le();
20292 __struct.param4 = buf.get_f32_le();
20293 __struct.x = buf.get_f32_le();
20294 __struct.y = buf.get_f32_le();
20295 __struct.z = buf.get_f32_le();
20296 __struct.seq = buf.get_u16_le();
20297 let tmp = buf.get_u16_le();
20298 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
20299 ::mavlink_core::error::ParserError::InvalidEnum {
20300 enum_type: "MavCmd",
20301 value: tmp as u32,
20302 },
20303 )?;
20304 __struct.target_system = buf.get_u8();
20305 __struct.target_component = buf.get_u8();
20306 let tmp = buf.get_u8();
20307 __struct.frame =
20308 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20309 enum_type: "MavFrame",
20310 value: tmp as u32,
20311 })?;
20312 __struct.current = buf.get_u8();
20313 __struct.autocontinue = buf.get_u8();
20314 let tmp = buf.get_u8();
20315 __struct.mission_type =
20316 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20317 enum_type: "MavMissionType",
20318 value: tmp as u32,
20319 })?;
20320 Ok(__struct)
20321 }
20322 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20323 let mut __tmp = BytesMut::new(bytes);
20324 #[allow(clippy::absurd_extreme_comparisons)]
20325 #[allow(unused_comparisons)]
20326 if __tmp.remaining() < Self::ENCODED_LEN {
20327 panic!(
20328 "buffer is too small (need {} bytes, but got {})",
20329 Self::ENCODED_LEN,
20330 __tmp.remaining(),
20331 )
20332 }
20333 __tmp.put_f32_le(self.param1);
20334 __tmp.put_f32_le(self.param2);
20335 __tmp.put_f32_le(self.param3);
20336 __tmp.put_f32_le(self.param4);
20337 __tmp.put_f32_le(self.x);
20338 __tmp.put_f32_le(self.y);
20339 __tmp.put_f32_le(self.z);
20340 __tmp.put_u16_le(self.seq);
20341 __tmp.put_u16_le(self.command as u16);
20342 __tmp.put_u8(self.target_system);
20343 __tmp.put_u8(self.target_component);
20344 __tmp.put_u8(self.frame as u8);
20345 __tmp.put_u8(self.current);
20346 __tmp.put_u8(self.autocontinue);
20347 if matches!(version, MavlinkVersion::V2) {
20348 __tmp.put_u8(self.mission_type as u8);
20349 let len = __tmp.len();
20350 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20351 } else {
20352 __tmp.len()
20353 }
20354 }
20355}
20356#[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
20357#[doc = ""]
20358#[doc = "ID: 73"]
20359#[derive(Debug, Clone, PartialEq)]
20360#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20361#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20362#[cfg_attr(feature = "ts", derive(TS))]
20363#[cfg_attr(feature = "ts", ts(export))]
20364pub struct MISSION_ITEM_INT_DATA {
20365 #[doc = "PARAM1, see MAV_CMD enum"]
20366 pub param1: f32,
20367 #[doc = "PARAM2, see MAV_CMD enum"]
20368 pub param2: f32,
20369 #[doc = "PARAM3, see MAV_CMD enum"]
20370 pub param3: f32,
20371 #[doc = "PARAM4, see MAV_CMD enum"]
20372 pub param4: f32,
20373 #[doc = "PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7"]
20374 pub x: i32,
20375 #[doc = "PARAM6 / y position: local: x position in meters * 1e4, global: longitude in degrees *10^7"]
20376 pub y: i32,
20377 #[doc = "PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame."]
20378 pub z: f32,
20379 #[doc = "Waypoint ID (sequence number). Starts at zero. Increases monotonically for each waypoint, no gaps in the sequence (0,1,2,3,4)."]
20380 pub seq: u16,
20381 #[doc = "The scheduled action for the waypoint."]
20382 pub command: MavCmd,
20383 #[doc = "System ID"]
20384 pub target_system: u8,
20385 #[doc = "Component ID"]
20386 pub target_component: u8,
20387 #[doc = "The coordinate system of the waypoint."]
20388 pub frame: MavFrame,
20389 #[doc = "false:0, true:1"]
20390 pub current: u8,
20391 #[doc = "Autocontinue to next waypoint. 0: false, 1: true. Set false to pause mission after the item completes."]
20392 pub autocontinue: u8,
20393 #[doc = "Mission type."]
20394 #[cfg_attr(feature = "serde", serde(default))]
20395 pub mission_type: MavMissionType,
20396}
20397impl MISSION_ITEM_INT_DATA {
20398 pub const ENCODED_LEN: usize = 38usize;
20399 pub const DEFAULT: Self = Self {
20400 param1: 0.0_f32,
20401 param2: 0.0_f32,
20402 param3: 0.0_f32,
20403 param4: 0.0_f32,
20404 x: 0_i32,
20405 y: 0_i32,
20406 z: 0.0_f32,
20407 seq: 0_u16,
20408 command: MavCmd::DEFAULT,
20409 target_system: 0_u8,
20410 target_component: 0_u8,
20411 frame: MavFrame::DEFAULT,
20412 current: 0_u8,
20413 autocontinue: 0_u8,
20414 mission_type: MavMissionType::DEFAULT,
20415 };
20416 #[cfg(feature = "arbitrary")]
20417 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20418 use arbitrary::{Arbitrary, Unstructured};
20419 let mut buf = [0u8; 1024];
20420 rng.fill_bytes(&mut buf);
20421 let mut unstructured = Unstructured::new(&buf);
20422 Self::arbitrary(&mut unstructured).unwrap_or_default()
20423 }
20424}
20425impl Default for MISSION_ITEM_INT_DATA {
20426 fn default() -> Self {
20427 Self::DEFAULT.clone()
20428 }
20429}
20430impl MessageData for MISSION_ITEM_INT_DATA {
20431 type Message = MavMessage;
20432 const ID: u32 = 73u32;
20433 const NAME: &'static str = "MISSION_ITEM_INT";
20434 const EXTRA_CRC: u8 = 38u8;
20435 const ENCODED_LEN: usize = 38usize;
20436 fn deser(
20437 _version: MavlinkVersion,
20438 __input: &[u8],
20439 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20440 let avail_len = __input.len();
20441 let mut payload_buf = [0; Self::ENCODED_LEN];
20442 let mut buf = if avail_len < Self::ENCODED_LEN {
20443 payload_buf[0..avail_len].copy_from_slice(__input);
20444 Bytes::new(&payload_buf)
20445 } else {
20446 Bytes::new(__input)
20447 };
20448 let mut __struct = Self::default();
20449 __struct.param1 = buf.get_f32_le();
20450 __struct.param2 = buf.get_f32_le();
20451 __struct.param3 = buf.get_f32_le();
20452 __struct.param4 = buf.get_f32_le();
20453 __struct.x = buf.get_i32_le();
20454 __struct.y = buf.get_i32_le();
20455 __struct.z = buf.get_f32_le();
20456 __struct.seq = buf.get_u16_le();
20457 let tmp = buf.get_u16_le();
20458 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
20459 ::mavlink_core::error::ParserError::InvalidEnum {
20460 enum_type: "MavCmd",
20461 value: tmp as u32,
20462 },
20463 )?;
20464 __struct.target_system = buf.get_u8();
20465 __struct.target_component = buf.get_u8();
20466 let tmp = buf.get_u8();
20467 __struct.frame =
20468 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20469 enum_type: "MavFrame",
20470 value: tmp as u32,
20471 })?;
20472 __struct.current = buf.get_u8();
20473 __struct.autocontinue = buf.get_u8();
20474 let tmp = buf.get_u8();
20475 __struct.mission_type =
20476 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20477 enum_type: "MavMissionType",
20478 value: tmp as u32,
20479 })?;
20480 Ok(__struct)
20481 }
20482 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20483 let mut __tmp = BytesMut::new(bytes);
20484 #[allow(clippy::absurd_extreme_comparisons)]
20485 #[allow(unused_comparisons)]
20486 if __tmp.remaining() < Self::ENCODED_LEN {
20487 panic!(
20488 "buffer is too small (need {} bytes, but got {})",
20489 Self::ENCODED_LEN,
20490 __tmp.remaining(),
20491 )
20492 }
20493 __tmp.put_f32_le(self.param1);
20494 __tmp.put_f32_le(self.param2);
20495 __tmp.put_f32_le(self.param3);
20496 __tmp.put_f32_le(self.param4);
20497 __tmp.put_i32_le(self.x);
20498 __tmp.put_i32_le(self.y);
20499 __tmp.put_f32_le(self.z);
20500 __tmp.put_u16_le(self.seq);
20501 __tmp.put_u16_le(self.command as u16);
20502 __tmp.put_u8(self.target_system);
20503 __tmp.put_u8(self.target_component);
20504 __tmp.put_u8(self.frame as u8);
20505 __tmp.put_u8(self.current);
20506 __tmp.put_u8(self.autocontinue);
20507 if matches!(version, MavlinkVersion::V2) {
20508 __tmp.put_u8(self.mission_type as u8);
20509 let len = __tmp.len();
20510 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20511 } else {
20512 __tmp.len()
20513 }
20514 }
20515}
20516#[doc = "A certain mission item has been reached. The system will either hold this position (or circle on the orbit) or (if the autocontinue on the WP was set) continue to the next waypoint."]
20517#[doc = ""]
20518#[doc = "ID: 46"]
20519#[derive(Debug, Clone, PartialEq)]
20520#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20521#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20522#[cfg_attr(feature = "ts", derive(TS))]
20523#[cfg_attr(feature = "ts", ts(export))]
20524pub struct MISSION_ITEM_REACHED_DATA {
20525 #[doc = "Sequence"]
20526 pub seq: u16,
20527}
20528impl MISSION_ITEM_REACHED_DATA {
20529 pub const ENCODED_LEN: usize = 2usize;
20530 pub const DEFAULT: Self = Self { seq: 0_u16 };
20531 #[cfg(feature = "arbitrary")]
20532 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20533 use arbitrary::{Arbitrary, Unstructured};
20534 let mut buf = [0u8; 1024];
20535 rng.fill_bytes(&mut buf);
20536 let mut unstructured = Unstructured::new(&buf);
20537 Self::arbitrary(&mut unstructured).unwrap_or_default()
20538 }
20539}
20540impl Default for MISSION_ITEM_REACHED_DATA {
20541 fn default() -> Self {
20542 Self::DEFAULT.clone()
20543 }
20544}
20545impl MessageData for MISSION_ITEM_REACHED_DATA {
20546 type Message = MavMessage;
20547 const ID: u32 = 46u32;
20548 const NAME: &'static str = "MISSION_ITEM_REACHED";
20549 const EXTRA_CRC: u8 = 11u8;
20550 const ENCODED_LEN: usize = 2usize;
20551 fn deser(
20552 _version: MavlinkVersion,
20553 __input: &[u8],
20554 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20555 let avail_len = __input.len();
20556 let mut payload_buf = [0; Self::ENCODED_LEN];
20557 let mut buf = if avail_len < Self::ENCODED_LEN {
20558 payload_buf[0..avail_len].copy_from_slice(__input);
20559 Bytes::new(&payload_buf)
20560 } else {
20561 Bytes::new(__input)
20562 };
20563 let mut __struct = Self::default();
20564 __struct.seq = buf.get_u16_le();
20565 Ok(__struct)
20566 }
20567 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20568 let mut __tmp = BytesMut::new(bytes);
20569 #[allow(clippy::absurd_extreme_comparisons)]
20570 #[allow(unused_comparisons)]
20571 if __tmp.remaining() < Self::ENCODED_LEN {
20572 panic!(
20573 "buffer is too small (need {} bytes, but got {})",
20574 Self::ENCODED_LEN,
20575 __tmp.remaining(),
20576 )
20577 }
20578 __tmp.put_u16_le(self.seq);
20579 if matches!(version, MavlinkVersion::V2) {
20580 let len = __tmp.len();
20581 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20582 } else {
20583 __tmp.len()
20584 }
20585 }
20586}
20587#[deprecated = "A system that gets this request should respond with MISSION_ITEM_INT (as though MISSION_REQUEST_INT was received). See `MISSION_REQUEST_INT` (Deprecated since 2020-06)"]
20588#[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM message. <https://mavlink.io/en/services/mission.html>."]
20589#[doc = ""]
20590#[doc = "ID: 40"]
20591#[derive(Debug, Clone, PartialEq)]
20592#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20593#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20594#[cfg_attr(feature = "ts", derive(TS))]
20595#[cfg_attr(feature = "ts", ts(export))]
20596pub struct MISSION_REQUEST_DATA {
20597 #[doc = "Sequence"]
20598 pub seq: u16,
20599 #[doc = "System ID"]
20600 pub target_system: u8,
20601 #[doc = "Component ID"]
20602 pub target_component: u8,
20603 #[doc = "Mission type."]
20604 #[cfg_attr(feature = "serde", serde(default))]
20605 pub mission_type: MavMissionType,
20606}
20607impl MISSION_REQUEST_DATA {
20608 pub const ENCODED_LEN: usize = 5usize;
20609 pub const DEFAULT: Self = Self {
20610 seq: 0_u16,
20611 target_system: 0_u8,
20612 target_component: 0_u8,
20613 mission_type: MavMissionType::DEFAULT,
20614 };
20615 #[cfg(feature = "arbitrary")]
20616 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20617 use arbitrary::{Arbitrary, Unstructured};
20618 let mut buf = [0u8; 1024];
20619 rng.fill_bytes(&mut buf);
20620 let mut unstructured = Unstructured::new(&buf);
20621 Self::arbitrary(&mut unstructured).unwrap_or_default()
20622 }
20623}
20624impl Default for MISSION_REQUEST_DATA {
20625 fn default() -> Self {
20626 Self::DEFAULT.clone()
20627 }
20628}
20629impl MessageData for MISSION_REQUEST_DATA {
20630 type Message = MavMessage;
20631 const ID: u32 = 40u32;
20632 const NAME: &'static str = "MISSION_REQUEST";
20633 const EXTRA_CRC: u8 = 230u8;
20634 const ENCODED_LEN: usize = 5usize;
20635 fn deser(
20636 _version: MavlinkVersion,
20637 __input: &[u8],
20638 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20639 let avail_len = __input.len();
20640 let mut payload_buf = [0; Self::ENCODED_LEN];
20641 let mut buf = if avail_len < Self::ENCODED_LEN {
20642 payload_buf[0..avail_len].copy_from_slice(__input);
20643 Bytes::new(&payload_buf)
20644 } else {
20645 Bytes::new(__input)
20646 };
20647 let mut __struct = Self::default();
20648 __struct.seq = buf.get_u16_le();
20649 __struct.target_system = buf.get_u8();
20650 __struct.target_component = buf.get_u8();
20651 let tmp = buf.get_u8();
20652 __struct.mission_type =
20653 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20654 enum_type: "MavMissionType",
20655 value: tmp as u32,
20656 })?;
20657 Ok(__struct)
20658 }
20659 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20660 let mut __tmp = BytesMut::new(bytes);
20661 #[allow(clippy::absurd_extreme_comparisons)]
20662 #[allow(unused_comparisons)]
20663 if __tmp.remaining() < Self::ENCODED_LEN {
20664 panic!(
20665 "buffer is too small (need {} bytes, but got {})",
20666 Self::ENCODED_LEN,
20667 __tmp.remaining(),
20668 )
20669 }
20670 __tmp.put_u16_le(self.seq);
20671 __tmp.put_u8(self.target_system);
20672 __tmp.put_u8(self.target_component);
20673 if matches!(version, MavlinkVersion::V2) {
20674 __tmp.put_u8(self.mission_type as u8);
20675 let len = __tmp.len();
20676 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20677 } else {
20678 __tmp.len()
20679 }
20680 }
20681}
20682#[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM_INT message. <https://mavlink.io/en/services/mission.html>."]
20683#[doc = ""]
20684#[doc = "ID: 51"]
20685#[derive(Debug, Clone, PartialEq)]
20686#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20687#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20688#[cfg_attr(feature = "ts", derive(TS))]
20689#[cfg_attr(feature = "ts", ts(export))]
20690pub struct MISSION_REQUEST_INT_DATA {
20691 #[doc = "Sequence"]
20692 pub seq: u16,
20693 #[doc = "System ID"]
20694 pub target_system: u8,
20695 #[doc = "Component ID"]
20696 pub target_component: u8,
20697 #[doc = "Mission type."]
20698 #[cfg_attr(feature = "serde", serde(default))]
20699 pub mission_type: MavMissionType,
20700}
20701impl MISSION_REQUEST_INT_DATA {
20702 pub const ENCODED_LEN: usize = 5usize;
20703 pub const DEFAULT: Self = Self {
20704 seq: 0_u16,
20705 target_system: 0_u8,
20706 target_component: 0_u8,
20707 mission_type: MavMissionType::DEFAULT,
20708 };
20709 #[cfg(feature = "arbitrary")]
20710 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20711 use arbitrary::{Arbitrary, Unstructured};
20712 let mut buf = [0u8; 1024];
20713 rng.fill_bytes(&mut buf);
20714 let mut unstructured = Unstructured::new(&buf);
20715 Self::arbitrary(&mut unstructured).unwrap_or_default()
20716 }
20717}
20718impl Default for MISSION_REQUEST_INT_DATA {
20719 fn default() -> Self {
20720 Self::DEFAULT.clone()
20721 }
20722}
20723impl MessageData for MISSION_REQUEST_INT_DATA {
20724 type Message = MavMessage;
20725 const ID: u32 = 51u32;
20726 const NAME: &'static str = "MISSION_REQUEST_INT";
20727 const EXTRA_CRC: u8 = 196u8;
20728 const ENCODED_LEN: usize = 5usize;
20729 fn deser(
20730 _version: MavlinkVersion,
20731 __input: &[u8],
20732 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20733 let avail_len = __input.len();
20734 let mut payload_buf = [0; Self::ENCODED_LEN];
20735 let mut buf = if avail_len < Self::ENCODED_LEN {
20736 payload_buf[0..avail_len].copy_from_slice(__input);
20737 Bytes::new(&payload_buf)
20738 } else {
20739 Bytes::new(__input)
20740 };
20741 let mut __struct = Self::default();
20742 __struct.seq = buf.get_u16_le();
20743 __struct.target_system = buf.get_u8();
20744 __struct.target_component = buf.get_u8();
20745 let tmp = buf.get_u8();
20746 __struct.mission_type =
20747 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20748 enum_type: "MavMissionType",
20749 value: tmp as u32,
20750 })?;
20751 Ok(__struct)
20752 }
20753 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20754 let mut __tmp = BytesMut::new(bytes);
20755 #[allow(clippy::absurd_extreme_comparisons)]
20756 #[allow(unused_comparisons)]
20757 if __tmp.remaining() < Self::ENCODED_LEN {
20758 panic!(
20759 "buffer is too small (need {} bytes, but got {})",
20760 Self::ENCODED_LEN,
20761 __tmp.remaining(),
20762 )
20763 }
20764 __tmp.put_u16_le(self.seq);
20765 __tmp.put_u8(self.target_system);
20766 __tmp.put_u8(self.target_component);
20767 if matches!(version, MavlinkVersion::V2) {
20768 __tmp.put_u8(self.mission_type as u8);
20769 let len = __tmp.len();
20770 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20771 } else {
20772 __tmp.len()
20773 }
20774 }
20775}
20776#[doc = "Request the overall list of mission items from the system/component."]
20777#[doc = ""]
20778#[doc = "ID: 43"]
20779#[derive(Debug, Clone, PartialEq)]
20780#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20781#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20782#[cfg_attr(feature = "ts", derive(TS))]
20783#[cfg_attr(feature = "ts", ts(export))]
20784pub struct MISSION_REQUEST_LIST_DATA {
20785 #[doc = "System ID"]
20786 pub target_system: u8,
20787 #[doc = "Component ID"]
20788 pub target_component: u8,
20789 #[doc = "Mission type."]
20790 #[cfg_attr(feature = "serde", serde(default))]
20791 pub mission_type: MavMissionType,
20792}
20793impl MISSION_REQUEST_LIST_DATA {
20794 pub const ENCODED_LEN: usize = 3usize;
20795 pub const DEFAULT: Self = Self {
20796 target_system: 0_u8,
20797 target_component: 0_u8,
20798 mission_type: MavMissionType::DEFAULT,
20799 };
20800 #[cfg(feature = "arbitrary")]
20801 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20802 use arbitrary::{Arbitrary, Unstructured};
20803 let mut buf = [0u8; 1024];
20804 rng.fill_bytes(&mut buf);
20805 let mut unstructured = Unstructured::new(&buf);
20806 Self::arbitrary(&mut unstructured).unwrap_or_default()
20807 }
20808}
20809impl Default for MISSION_REQUEST_LIST_DATA {
20810 fn default() -> Self {
20811 Self::DEFAULT.clone()
20812 }
20813}
20814impl MessageData for MISSION_REQUEST_LIST_DATA {
20815 type Message = MavMessage;
20816 const ID: u32 = 43u32;
20817 const NAME: &'static str = "MISSION_REQUEST_LIST";
20818 const EXTRA_CRC: u8 = 132u8;
20819 const ENCODED_LEN: usize = 3usize;
20820 fn deser(
20821 _version: MavlinkVersion,
20822 __input: &[u8],
20823 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20824 let avail_len = __input.len();
20825 let mut payload_buf = [0; Self::ENCODED_LEN];
20826 let mut buf = if avail_len < Self::ENCODED_LEN {
20827 payload_buf[0..avail_len].copy_from_slice(__input);
20828 Bytes::new(&payload_buf)
20829 } else {
20830 Bytes::new(__input)
20831 };
20832 let mut __struct = Self::default();
20833 __struct.target_system = buf.get_u8();
20834 __struct.target_component = buf.get_u8();
20835 let tmp = buf.get_u8();
20836 __struct.mission_type =
20837 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20838 enum_type: "MavMissionType",
20839 value: tmp as u32,
20840 })?;
20841 Ok(__struct)
20842 }
20843 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20844 let mut __tmp = BytesMut::new(bytes);
20845 #[allow(clippy::absurd_extreme_comparisons)]
20846 #[allow(unused_comparisons)]
20847 if __tmp.remaining() < Self::ENCODED_LEN {
20848 panic!(
20849 "buffer is too small (need {} bytes, but got {})",
20850 Self::ENCODED_LEN,
20851 __tmp.remaining(),
20852 )
20853 }
20854 __tmp.put_u8(self.target_system);
20855 __tmp.put_u8(self.target_component);
20856 if matches!(version, MavlinkVersion::V2) {
20857 __tmp.put_u8(self.mission_type as u8);
20858 let len = __tmp.len();
20859 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20860 } else {
20861 __tmp.len()
20862 }
20863 }
20864}
20865#[doc = "Request a partial list of mission items from the system/component. <https://mavlink.io/en/services/mission.html>. If start and end index are the same, just send one waypoint."]
20866#[doc = ""]
20867#[doc = "ID: 37"]
20868#[derive(Debug, Clone, PartialEq)]
20869#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20870#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20871#[cfg_attr(feature = "ts", derive(TS))]
20872#[cfg_attr(feature = "ts", ts(export))]
20873pub struct MISSION_REQUEST_PARTIAL_LIST_DATA {
20874 #[doc = "Start index"]
20875 pub start_index: i16,
20876 #[doc = "End index, -1 by default (-1: send list to end). Else a valid index of the list"]
20877 pub end_index: i16,
20878 #[doc = "System ID"]
20879 pub target_system: u8,
20880 #[doc = "Component ID"]
20881 pub target_component: u8,
20882 #[doc = "Mission type."]
20883 #[cfg_attr(feature = "serde", serde(default))]
20884 pub mission_type: MavMissionType,
20885}
20886impl MISSION_REQUEST_PARTIAL_LIST_DATA {
20887 pub const ENCODED_LEN: usize = 7usize;
20888 pub const DEFAULT: Self = Self {
20889 start_index: 0_i16,
20890 end_index: 0_i16,
20891 target_system: 0_u8,
20892 target_component: 0_u8,
20893 mission_type: MavMissionType::DEFAULT,
20894 };
20895 #[cfg(feature = "arbitrary")]
20896 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20897 use arbitrary::{Arbitrary, Unstructured};
20898 let mut buf = [0u8; 1024];
20899 rng.fill_bytes(&mut buf);
20900 let mut unstructured = Unstructured::new(&buf);
20901 Self::arbitrary(&mut unstructured).unwrap_or_default()
20902 }
20903}
20904impl Default for MISSION_REQUEST_PARTIAL_LIST_DATA {
20905 fn default() -> Self {
20906 Self::DEFAULT.clone()
20907 }
20908}
20909impl MessageData for MISSION_REQUEST_PARTIAL_LIST_DATA {
20910 type Message = MavMessage;
20911 const ID: u32 = 37u32;
20912 const NAME: &'static str = "MISSION_REQUEST_PARTIAL_LIST";
20913 const EXTRA_CRC: u8 = 212u8;
20914 const ENCODED_LEN: usize = 7usize;
20915 fn deser(
20916 _version: MavlinkVersion,
20917 __input: &[u8],
20918 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20919 let avail_len = __input.len();
20920 let mut payload_buf = [0; Self::ENCODED_LEN];
20921 let mut buf = if avail_len < Self::ENCODED_LEN {
20922 payload_buf[0..avail_len].copy_from_slice(__input);
20923 Bytes::new(&payload_buf)
20924 } else {
20925 Bytes::new(__input)
20926 };
20927 let mut __struct = Self::default();
20928 __struct.start_index = buf.get_i16_le();
20929 __struct.end_index = buf.get_i16_le();
20930 __struct.target_system = buf.get_u8();
20931 __struct.target_component = buf.get_u8();
20932 let tmp = buf.get_u8();
20933 __struct.mission_type =
20934 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20935 enum_type: "MavMissionType",
20936 value: tmp as u32,
20937 })?;
20938 Ok(__struct)
20939 }
20940 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20941 let mut __tmp = BytesMut::new(bytes);
20942 #[allow(clippy::absurd_extreme_comparisons)]
20943 #[allow(unused_comparisons)]
20944 if __tmp.remaining() < Self::ENCODED_LEN {
20945 panic!(
20946 "buffer is too small (need {} bytes, but got {})",
20947 Self::ENCODED_LEN,
20948 __tmp.remaining(),
20949 )
20950 }
20951 __tmp.put_i16_le(self.start_index);
20952 __tmp.put_i16_le(self.end_index);
20953 __tmp.put_u8(self.target_system);
20954 __tmp.put_u8(self.target_component);
20955 if matches!(version, MavlinkVersion::V2) {
20956 __tmp.put_u8(self.mission_type as u8);
20957 let len = __tmp.len();
20958 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20959 } else {
20960 __tmp.len()
20961 }
20962 }
20963}
20964#[deprecated = " See `MAV_CMD_DO_SET_MISSION_CURRENT` (Deprecated since 2022-08)"]
20965#[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. Note that mission jump repeat counters are not reset (see MAV_CMD_DO_JUMP param2). This message may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this message must not trigger a switch to mission mode."]
20966#[doc = ""]
20967#[doc = "ID: 41"]
20968#[derive(Debug, Clone, PartialEq)]
20969#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20970#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20971#[cfg_attr(feature = "ts", derive(TS))]
20972#[cfg_attr(feature = "ts", ts(export))]
20973pub struct MISSION_SET_CURRENT_DATA {
20974 #[doc = "Sequence"]
20975 pub seq: u16,
20976 #[doc = "System ID"]
20977 pub target_system: u8,
20978 #[doc = "Component ID"]
20979 pub target_component: u8,
20980}
20981impl MISSION_SET_CURRENT_DATA {
20982 pub const ENCODED_LEN: usize = 4usize;
20983 pub const DEFAULT: Self = Self {
20984 seq: 0_u16,
20985 target_system: 0_u8,
20986 target_component: 0_u8,
20987 };
20988 #[cfg(feature = "arbitrary")]
20989 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20990 use arbitrary::{Arbitrary, Unstructured};
20991 let mut buf = [0u8; 1024];
20992 rng.fill_bytes(&mut buf);
20993 let mut unstructured = Unstructured::new(&buf);
20994 Self::arbitrary(&mut unstructured).unwrap_or_default()
20995 }
20996}
20997impl Default for MISSION_SET_CURRENT_DATA {
20998 fn default() -> Self {
20999 Self::DEFAULT.clone()
21000 }
21001}
21002impl MessageData for MISSION_SET_CURRENT_DATA {
21003 type Message = MavMessage;
21004 const ID: u32 = 41u32;
21005 const NAME: &'static str = "MISSION_SET_CURRENT";
21006 const EXTRA_CRC: u8 = 28u8;
21007 const ENCODED_LEN: usize = 4usize;
21008 fn deser(
21009 _version: MavlinkVersion,
21010 __input: &[u8],
21011 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21012 let avail_len = __input.len();
21013 let mut payload_buf = [0; Self::ENCODED_LEN];
21014 let mut buf = if avail_len < Self::ENCODED_LEN {
21015 payload_buf[0..avail_len].copy_from_slice(__input);
21016 Bytes::new(&payload_buf)
21017 } else {
21018 Bytes::new(__input)
21019 };
21020 let mut __struct = Self::default();
21021 __struct.seq = buf.get_u16_le();
21022 __struct.target_system = buf.get_u8();
21023 __struct.target_component = buf.get_u8();
21024 Ok(__struct)
21025 }
21026 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21027 let mut __tmp = BytesMut::new(bytes);
21028 #[allow(clippy::absurd_extreme_comparisons)]
21029 #[allow(unused_comparisons)]
21030 if __tmp.remaining() < Self::ENCODED_LEN {
21031 panic!(
21032 "buffer is too small (need {} bytes, but got {})",
21033 Self::ENCODED_LEN,
21034 __tmp.remaining(),
21035 )
21036 }
21037 __tmp.put_u16_le(self.seq);
21038 __tmp.put_u8(self.target_system);
21039 __tmp.put_u8(self.target_component);
21040 if matches!(version, MavlinkVersion::V2) {
21041 let len = __tmp.len();
21042 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21043 } else {
21044 __tmp.len()
21045 }
21046 }
21047}
21048#[doc = "This message is sent to the MAV to write a partial list. If start index == end index, only one item will be transmitted / updated. If the start index is NOT 0 and above the current list size, this request should be REJECTED!."]
21049#[doc = ""]
21050#[doc = "ID: 38"]
21051#[derive(Debug, Clone, PartialEq)]
21052#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21053#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21054#[cfg_attr(feature = "ts", derive(TS))]
21055#[cfg_attr(feature = "ts", ts(export))]
21056pub struct MISSION_WRITE_PARTIAL_LIST_DATA {
21057 #[doc = "Start index. Must be smaller / equal to the largest index of the current onboard list."]
21058 pub start_index: i16,
21059 #[doc = "End index, equal or greater than start index."]
21060 pub end_index: i16,
21061 #[doc = "System ID"]
21062 pub target_system: u8,
21063 #[doc = "Component ID"]
21064 pub target_component: u8,
21065 #[doc = "Mission type."]
21066 #[cfg_attr(feature = "serde", serde(default))]
21067 pub mission_type: MavMissionType,
21068}
21069impl MISSION_WRITE_PARTIAL_LIST_DATA {
21070 pub const ENCODED_LEN: usize = 7usize;
21071 pub const DEFAULT: Self = Self {
21072 start_index: 0_i16,
21073 end_index: 0_i16,
21074 target_system: 0_u8,
21075 target_component: 0_u8,
21076 mission_type: MavMissionType::DEFAULT,
21077 };
21078 #[cfg(feature = "arbitrary")]
21079 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21080 use arbitrary::{Arbitrary, Unstructured};
21081 let mut buf = [0u8; 1024];
21082 rng.fill_bytes(&mut buf);
21083 let mut unstructured = Unstructured::new(&buf);
21084 Self::arbitrary(&mut unstructured).unwrap_or_default()
21085 }
21086}
21087impl Default for MISSION_WRITE_PARTIAL_LIST_DATA {
21088 fn default() -> Self {
21089 Self::DEFAULT.clone()
21090 }
21091}
21092impl MessageData for MISSION_WRITE_PARTIAL_LIST_DATA {
21093 type Message = MavMessage;
21094 const ID: u32 = 38u32;
21095 const NAME: &'static str = "MISSION_WRITE_PARTIAL_LIST";
21096 const EXTRA_CRC: u8 = 9u8;
21097 const ENCODED_LEN: usize = 7usize;
21098 fn deser(
21099 _version: MavlinkVersion,
21100 __input: &[u8],
21101 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21102 let avail_len = __input.len();
21103 let mut payload_buf = [0; Self::ENCODED_LEN];
21104 let mut buf = if avail_len < Self::ENCODED_LEN {
21105 payload_buf[0..avail_len].copy_from_slice(__input);
21106 Bytes::new(&payload_buf)
21107 } else {
21108 Bytes::new(__input)
21109 };
21110 let mut __struct = Self::default();
21111 __struct.start_index = buf.get_i16_le();
21112 __struct.end_index = buf.get_i16_le();
21113 __struct.target_system = buf.get_u8();
21114 __struct.target_component = buf.get_u8();
21115 let tmp = buf.get_u8();
21116 __struct.mission_type =
21117 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21118 enum_type: "MavMissionType",
21119 value: tmp as u32,
21120 })?;
21121 Ok(__struct)
21122 }
21123 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21124 let mut __tmp = BytesMut::new(bytes);
21125 #[allow(clippy::absurd_extreme_comparisons)]
21126 #[allow(unused_comparisons)]
21127 if __tmp.remaining() < Self::ENCODED_LEN {
21128 panic!(
21129 "buffer is too small (need {} bytes, but got {})",
21130 Self::ENCODED_LEN,
21131 __tmp.remaining(),
21132 )
21133 }
21134 __tmp.put_i16_le(self.start_index);
21135 __tmp.put_i16_le(self.end_index);
21136 __tmp.put_u8(self.target_system);
21137 __tmp.put_u8(self.target_component);
21138 if matches!(version, MavlinkVersion::V2) {
21139 __tmp.put_u8(self.mission_type as u8);
21140 let len = __tmp.len();
21141 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21142 } else {
21143 __tmp.len()
21144 }
21145 }
21146}
21147#[deprecated = "This message is being superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
21148#[doc = "Orientation of a mount."]
21149#[doc = ""]
21150#[doc = "ID: 265"]
21151#[derive(Debug, Clone, PartialEq)]
21152#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21153#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21154#[cfg_attr(feature = "ts", derive(TS))]
21155#[cfg_attr(feature = "ts", ts(export))]
21156pub struct MOUNT_ORIENTATION_DATA {
21157 #[doc = "Timestamp (time since system boot)."]
21158 pub time_boot_ms: u32,
21159 #[doc = "Roll in global frame (set to NaN for invalid)."]
21160 pub roll: f32,
21161 #[doc = "Pitch in global frame (set to NaN for invalid)."]
21162 pub pitch: f32,
21163 #[doc = "Yaw relative to vehicle (set to NaN for invalid)."]
21164 pub yaw: f32,
21165 #[doc = "Yaw in absolute frame relative to Earth's North, north is 0 (set to NaN for invalid)."]
21166 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21167 pub yaw_absolute: f32,
21168}
21169impl MOUNT_ORIENTATION_DATA {
21170 pub const ENCODED_LEN: usize = 20usize;
21171 pub const DEFAULT: Self = Self {
21172 time_boot_ms: 0_u32,
21173 roll: 0.0_f32,
21174 pitch: 0.0_f32,
21175 yaw: 0.0_f32,
21176 yaw_absolute: 0.0_f32,
21177 };
21178 #[cfg(feature = "arbitrary")]
21179 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21180 use arbitrary::{Arbitrary, Unstructured};
21181 let mut buf = [0u8; 1024];
21182 rng.fill_bytes(&mut buf);
21183 let mut unstructured = Unstructured::new(&buf);
21184 Self::arbitrary(&mut unstructured).unwrap_or_default()
21185 }
21186}
21187impl Default for MOUNT_ORIENTATION_DATA {
21188 fn default() -> Self {
21189 Self::DEFAULT.clone()
21190 }
21191}
21192impl MessageData for MOUNT_ORIENTATION_DATA {
21193 type Message = MavMessage;
21194 const ID: u32 = 265u32;
21195 const NAME: &'static str = "MOUNT_ORIENTATION";
21196 const EXTRA_CRC: u8 = 26u8;
21197 const ENCODED_LEN: usize = 20usize;
21198 fn deser(
21199 _version: MavlinkVersion,
21200 __input: &[u8],
21201 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21202 let avail_len = __input.len();
21203 let mut payload_buf = [0; Self::ENCODED_LEN];
21204 let mut buf = if avail_len < Self::ENCODED_LEN {
21205 payload_buf[0..avail_len].copy_from_slice(__input);
21206 Bytes::new(&payload_buf)
21207 } else {
21208 Bytes::new(__input)
21209 };
21210 let mut __struct = Self::default();
21211 __struct.time_boot_ms = buf.get_u32_le();
21212 __struct.roll = buf.get_f32_le();
21213 __struct.pitch = buf.get_f32_le();
21214 __struct.yaw = buf.get_f32_le();
21215 __struct.yaw_absolute = buf.get_f32_le();
21216 Ok(__struct)
21217 }
21218 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21219 let mut __tmp = BytesMut::new(bytes);
21220 #[allow(clippy::absurd_extreme_comparisons)]
21221 #[allow(unused_comparisons)]
21222 if __tmp.remaining() < Self::ENCODED_LEN {
21223 panic!(
21224 "buffer is too small (need {} bytes, but got {})",
21225 Self::ENCODED_LEN,
21226 __tmp.remaining(),
21227 )
21228 }
21229 __tmp.put_u32_le(self.time_boot_ms);
21230 __tmp.put_f32_le(self.roll);
21231 __tmp.put_f32_le(self.pitch);
21232 __tmp.put_f32_le(self.yaw);
21233 if matches!(version, MavlinkVersion::V2) {
21234 __tmp.put_f32_le(self.yaw_absolute);
21235 let len = __tmp.len();
21236 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21237 } else {
21238 __tmp.len()
21239 }
21240 }
21241}
21242#[doc = "Send a key-value pair as float. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
21243#[doc = ""]
21244#[doc = "ID: 251"]
21245#[derive(Debug, Clone, PartialEq)]
21246#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21247#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21248#[cfg_attr(feature = "ts", derive(TS))]
21249#[cfg_attr(feature = "ts", ts(export))]
21250pub struct NAMED_VALUE_FLOAT_DATA {
21251 #[doc = "Timestamp (time since system boot)."]
21252 pub time_boot_ms: u32,
21253 #[doc = "Floating point value"]
21254 pub value: f32,
21255 #[doc = "Name of the debug variable"]
21256 #[cfg_attr(
21257 feature = "serde",
21258 serde(
21259 serialize_with = "crate::nulstr::serialize::<_, 10>",
21260 deserialize_with = "crate::nulstr::deserialize::<_, 10>"
21261 )
21262 )]
21263 #[cfg_attr(feature = "ts", ts(type = "string"))]
21264 pub name: [u8; 10],
21265}
21266impl NAMED_VALUE_FLOAT_DATA {
21267 pub const ENCODED_LEN: usize = 18usize;
21268 pub const DEFAULT: Self = Self {
21269 time_boot_ms: 0_u32,
21270 value: 0.0_f32,
21271 name: [0_u8; 10usize],
21272 };
21273 #[cfg(feature = "arbitrary")]
21274 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21275 use arbitrary::{Arbitrary, Unstructured};
21276 let mut buf = [0u8; 1024];
21277 rng.fill_bytes(&mut buf);
21278 let mut unstructured = Unstructured::new(&buf);
21279 Self::arbitrary(&mut unstructured).unwrap_or_default()
21280 }
21281}
21282impl Default for NAMED_VALUE_FLOAT_DATA {
21283 fn default() -> Self {
21284 Self::DEFAULT.clone()
21285 }
21286}
21287impl MessageData for NAMED_VALUE_FLOAT_DATA {
21288 type Message = MavMessage;
21289 const ID: u32 = 251u32;
21290 const NAME: &'static str = "NAMED_VALUE_FLOAT";
21291 const EXTRA_CRC: u8 = 170u8;
21292 const ENCODED_LEN: usize = 18usize;
21293 fn deser(
21294 _version: MavlinkVersion,
21295 __input: &[u8],
21296 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21297 let avail_len = __input.len();
21298 let mut payload_buf = [0; Self::ENCODED_LEN];
21299 let mut buf = if avail_len < Self::ENCODED_LEN {
21300 payload_buf[0..avail_len].copy_from_slice(__input);
21301 Bytes::new(&payload_buf)
21302 } else {
21303 Bytes::new(__input)
21304 };
21305 let mut __struct = Self::default();
21306 __struct.time_boot_ms = buf.get_u32_le();
21307 __struct.value = buf.get_f32_le();
21308 for v in &mut __struct.name {
21309 let val = buf.get_u8();
21310 *v = val;
21311 }
21312 Ok(__struct)
21313 }
21314 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21315 let mut __tmp = BytesMut::new(bytes);
21316 #[allow(clippy::absurd_extreme_comparisons)]
21317 #[allow(unused_comparisons)]
21318 if __tmp.remaining() < Self::ENCODED_LEN {
21319 panic!(
21320 "buffer is too small (need {} bytes, but got {})",
21321 Self::ENCODED_LEN,
21322 __tmp.remaining(),
21323 )
21324 }
21325 __tmp.put_u32_le(self.time_boot_ms);
21326 __tmp.put_f32_le(self.value);
21327 for val in &self.name {
21328 __tmp.put_u8(*val);
21329 }
21330 if matches!(version, MavlinkVersion::V2) {
21331 let len = __tmp.len();
21332 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21333 } else {
21334 __tmp.len()
21335 }
21336 }
21337}
21338#[doc = "Send a key-value pair as integer. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
21339#[doc = ""]
21340#[doc = "ID: 252"]
21341#[derive(Debug, Clone, PartialEq)]
21342#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21343#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21344#[cfg_attr(feature = "ts", derive(TS))]
21345#[cfg_attr(feature = "ts", ts(export))]
21346pub struct NAMED_VALUE_INT_DATA {
21347 #[doc = "Timestamp (time since system boot)."]
21348 pub time_boot_ms: u32,
21349 #[doc = "Signed integer value"]
21350 pub value: i32,
21351 #[doc = "Name of the debug variable"]
21352 #[cfg_attr(
21353 feature = "serde",
21354 serde(
21355 serialize_with = "crate::nulstr::serialize::<_, 10>",
21356 deserialize_with = "crate::nulstr::deserialize::<_, 10>"
21357 )
21358 )]
21359 #[cfg_attr(feature = "ts", ts(type = "string"))]
21360 pub name: [u8; 10],
21361}
21362impl NAMED_VALUE_INT_DATA {
21363 pub const ENCODED_LEN: usize = 18usize;
21364 pub const DEFAULT: Self = Self {
21365 time_boot_ms: 0_u32,
21366 value: 0_i32,
21367 name: [0_u8; 10usize],
21368 };
21369 #[cfg(feature = "arbitrary")]
21370 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21371 use arbitrary::{Arbitrary, Unstructured};
21372 let mut buf = [0u8; 1024];
21373 rng.fill_bytes(&mut buf);
21374 let mut unstructured = Unstructured::new(&buf);
21375 Self::arbitrary(&mut unstructured).unwrap_or_default()
21376 }
21377}
21378impl Default for NAMED_VALUE_INT_DATA {
21379 fn default() -> Self {
21380 Self::DEFAULT.clone()
21381 }
21382}
21383impl MessageData for NAMED_VALUE_INT_DATA {
21384 type Message = MavMessage;
21385 const ID: u32 = 252u32;
21386 const NAME: &'static str = "NAMED_VALUE_INT";
21387 const EXTRA_CRC: u8 = 44u8;
21388 const ENCODED_LEN: usize = 18usize;
21389 fn deser(
21390 _version: MavlinkVersion,
21391 __input: &[u8],
21392 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21393 let avail_len = __input.len();
21394 let mut payload_buf = [0; Self::ENCODED_LEN];
21395 let mut buf = if avail_len < Self::ENCODED_LEN {
21396 payload_buf[0..avail_len].copy_from_slice(__input);
21397 Bytes::new(&payload_buf)
21398 } else {
21399 Bytes::new(__input)
21400 };
21401 let mut __struct = Self::default();
21402 __struct.time_boot_ms = buf.get_u32_le();
21403 __struct.value = buf.get_i32_le();
21404 for v in &mut __struct.name {
21405 let val = buf.get_u8();
21406 *v = val;
21407 }
21408 Ok(__struct)
21409 }
21410 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21411 let mut __tmp = BytesMut::new(bytes);
21412 #[allow(clippy::absurd_extreme_comparisons)]
21413 #[allow(unused_comparisons)]
21414 if __tmp.remaining() < Self::ENCODED_LEN {
21415 panic!(
21416 "buffer is too small (need {} bytes, but got {})",
21417 Self::ENCODED_LEN,
21418 __tmp.remaining(),
21419 )
21420 }
21421 __tmp.put_u32_le(self.time_boot_ms);
21422 __tmp.put_i32_le(self.value);
21423 for val in &self.name {
21424 __tmp.put_u8(*val);
21425 }
21426 if matches!(version, MavlinkVersion::V2) {
21427 let len = __tmp.len();
21428 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21429 } else {
21430 __tmp.len()
21431 }
21432 }
21433}
21434#[doc = "The state of the navigation and position controller."]
21435#[doc = ""]
21436#[doc = "ID: 62"]
21437#[derive(Debug, Clone, PartialEq)]
21438#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21439#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21440#[cfg_attr(feature = "ts", derive(TS))]
21441#[cfg_attr(feature = "ts", ts(export))]
21442pub struct NAV_CONTROLLER_OUTPUT_DATA {
21443 #[doc = "Current desired roll"]
21444 pub nav_roll: f32,
21445 #[doc = "Current desired pitch"]
21446 pub nav_pitch: f32,
21447 #[doc = "Current altitude error"]
21448 pub alt_error: f32,
21449 #[doc = "Current airspeed error"]
21450 pub aspd_error: f32,
21451 #[doc = "Current crosstrack error on x-y plane"]
21452 pub xtrack_error: f32,
21453 #[doc = "Current desired heading"]
21454 pub nav_bearing: i16,
21455 #[doc = "Bearing to current waypoint/target"]
21456 pub target_bearing: i16,
21457 #[doc = "Distance to active waypoint"]
21458 pub wp_dist: u16,
21459}
21460impl NAV_CONTROLLER_OUTPUT_DATA {
21461 pub const ENCODED_LEN: usize = 26usize;
21462 pub const DEFAULT: Self = Self {
21463 nav_roll: 0.0_f32,
21464 nav_pitch: 0.0_f32,
21465 alt_error: 0.0_f32,
21466 aspd_error: 0.0_f32,
21467 xtrack_error: 0.0_f32,
21468 nav_bearing: 0_i16,
21469 target_bearing: 0_i16,
21470 wp_dist: 0_u16,
21471 };
21472 #[cfg(feature = "arbitrary")]
21473 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21474 use arbitrary::{Arbitrary, Unstructured};
21475 let mut buf = [0u8; 1024];
21476 rng.fill_bytes(&mut buf);
21477 let mut unstructured = Unstructured::new(&buf);
21478 Self::arbitrary(&mut unstructured).unwrap_or_default()
21479 }
21480}
21481impl Default for NAV_CONTROLLER_OUTPUT_DATA {
21482 fn default() -> Self {
21483 Self::DEFAULT.clone()
21484 }
21485}
21486impl MessageData for NAV_CONTROLLER_OUTPUT_DATA {
21487 type Message = MavMessage;
21488 const ID: u32 = 62u32;
21489 const NAME: &'static str = "NAV_CONTROLLER_OUTPUT";
21490 const EXTRA_CRC: u8 = 183u8;
21491 const ENCODED_LEN: usize = 26usize;
21492 fn deser(
21493 _version: MavlinkVersion,
21494 __input: &[u8],
21495 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21496 let avail_len = __input.len();
21497 let mut payload_buf = [0; Self::ENCODED_LEN];
21498 let mut buf = if avail_len < Self::ENCODED_LEN {
21499 payload_buf[0..avail_len].copy_from_slice(__input);
21500 Bytes::new(&payload_buf)
21501 } else {
21502 Bytes::new(__input)
21503 };
21504 let mut __struct = Self::default();
21505 __struct.nav_roll = buf.get_f32_le();
21506 __struct.nav_pitch = buf.get_f32_le();
21507 __struct.alt_error = buf.get_f32_le();
21508 __struct.aspd_error = buf.get_f32_le();
21509 __struct.xtrack_error = buf.get_f32_le();
21510 __struct.nav_bearing = buf.get_i16_le();
21511 __struct.target_bearing = buf.get_i16_le();
21512 __struct.wp_dist = buf.get_u16_le();
21513 Ok(__struct)
21514 }
21515 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21516 let mut __tmp = BytesMut::new(bytes);
21517 #[allow(clippy::absurd_extreme_comparisons)]
21518 #[allow(unused_comparisons)]
21519 if __tmp.remaining() < Self::ENCODED_LEN {
21520 panic!(
21521 "buffer is too small (need {} bytes, but got {})",
21522 Self::ENCODED_LEN,
21523 __tmp.remaining(),
21524 )
21525 }
21526 __tmp.put_f32_le(self.nav_roll);
21527 __tmp.put_f32_le(self.nav_pitch);
21528 __tmp.put_f32_le(self.alt_error);
21529 __tmp.put_f32_le(self.aspd_error);
21530 __tmp.put_f32_le(self.xtrack_error);
21531 __tmp.put_i16_le(self.nav_bearing);
21532 __tmp.put_i16_le(self.target_bearing);
21533 __tmp.put_u16_le(self.wp_dist);
21534 if matches!(version, MavlinkVersion::V2) {
21535 let len = __tmp.len();
21536 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21537 } else {
21538 __tmp.len()
21539 }
21540 }
21541}
21542#[doc = "Obstacle distances in front of the sensor, starting from the left in increment degrees to the right."]
21543#[doc = ""]
21544#[doc = "ID: 330"]
21545#[derive(Debug, Clone, PartialEq)]
21546#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21547#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21548#[cfg_attr(feature = "ts", derive(TS))]
21549#[cfg_attr(feature = "ts", ts(export))]
21550pub struct OBSTACLE_DISTANCE_DATA {
21551 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
21552 pub time_usec: u64,
21553 #[doc = "Distance of obstacles around the vehicle with index 0 corresponding to north + angle_offset, unless otherwise specified in the frame. A value of 0 is valid and means that the obstacle is practically touching the sensor. A value of max_distance +1 means no obstacle is present. A value of UINT16_MAX for unknown/not used. In a array element, one unit corresponds to 1cm."]
21554 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21555 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21556 pub distances: [u16; 72],
21557 #[doc = "Minimum distance the sensor can measure."]
21558 pub min_distance: u16,
21559 #[doc = "Maximum distance the sensor can measure."]
21560 pub max_distance: u16,
21561 #[doc = "Class id of the distance sensor type."]
21562 pub sensor_type: MavDistanceSensor,
21563 #[doc = "Angular width in degrees of each array element. Increment direction is clockwise. This field is ignored if increment_f is non-zero."]
21564 pub increment: u8,
21565 #[doc = "Angular width in degrees of each array element as a float. If non-zero then this value is used instead of the uint8_t increment field. Positive is clockwise direction, negative is counter-clockwise."]
21566 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21567 pub increment_f: f32,
21568 #[doc = "Relative angle offset of the 0-index element in the distances array. Value of 0 corresponds to forward. Positive is clockwise direction, negative is counter-clockwise."]
21569 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21570 pub angle_offset: f32,
21571 #[doc = "Coordinate frame of reference for the yaw rotation and offset of the sensor data. Defaults to MAV_FRAME_GLOBAL, which is north aligned. For body-mounted sensors use MAV_FRAME_BODY_FRD, which is vehicle front aligned."]
21572 #[cfg_attr(feature = "serde", serde(default))]
21573 pub frame: MavFrame,
21574}
21575impl OBSTACLE_DISTANCE_DATA {
21576 pub const ENCODED_LEN: usize = 167usize;
21577 pub const DEFAULT: Self = Self {
21578 time_usec: 0_u64,
21579 distances: [0_u16; 72usize],
21580 min_distance: 0_u16,
21581 max_distance: 0_u16,
21582 sensor_type: MavDistanceSensor::DEFAULT,
21583 increment: 0_u8,
21584 increment_f: 0.0_f32,
21585 angle_offset: 0.0_f32,
21586 frame: MavFrame::DEFAULT,
21587 };
21588 #[cfg(feature = "arbitrary")]
21589 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21590 use arbitrary::{Arbitrary, Unstructured};
21591 let mut buf = [0u8; 1024];
21592 rng.fill_bytes(&mut buf);
21593 let mut unstructured = Unstructured::new(&buf);
21594 Self::arbitrary(&mut unstructured).unwrap_or_default()
21595 }
21596}
21597impl Default for OBSTACLE_DISTANCE_DATA {
21598 fn default() -> Self {
21599 Self::DEFAULT.clone()
21600 }
21601}
21602impl MessageData for OBSTACLE_DISTANCE_DATA {
21603 type Message = MavMessage;
21604 const ID: u32 = 330u32;
21605 const NAME: &'static str = "OBSTACLE_DISTANCE";
21606 const EXTRA_CRC: u8 = 23u8;
21607 const ENCODED_LEN: usize = 167usize;
21608 fn deser(
21609 _version: MavlinkVersion,
21610 __input: &[u8],
21611 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21612 let avail_len = __input.len();
21613 let mut payload_buf = [0; Self::ENCODED_LEN];
21614 let mut buf = if avail_len < Self::ENCODED_LEN {
21615 payload_buf[0..avail_len].copy_from_slice(__input);
21616 Bytes::new(&payload_buf)
21617 } else {
21618 Bytes::new(__input)
21619 };
21620 let mut __struct = Self::default();
21621 __struct.time_usec = buf.get_u64_le();
21622 for v in &mut __struct.distances {
21623 let val = buf.get_u16_le();
21624 *v = val;
21625 }
21626 __struct.min_distance = buf.get_u16_le();
21627 __struct.max_distance = buf.get_u16_le();
21628 let tmp = buf.get_u8();
21629 __struct.sensor_type =
21630 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21631 enum_type: "MavDistanceSensor",
21632 value: tmp as u32,
21633 })?;
21634 __struct.increment = buf.get_u8();
21635 __struct.increment_f = buf.get_f32_le();
21636 __struct.angle_offset = buf.get_f32_le();
21637 let tmp = buf.get_u8();
21638 __struct.frame =
21639 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21640 enum_type: "MavFrame",
21641 value: tmp as u32,
21642 })?;
21643 Ok(__struct)
21644 }
21645 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21646 let mut __tmp = BytesMut::new(bytes);
21647 #[allow(clippy::absurd_extreme_comparisons)]
21648 #[allow(unused_comparisons)]
21649 if __tmp.remaining() < Self::ENCODED_LEN {
21650 panic!(
21651 "buffer is too small (need {} bytes, but got {})",
21652 Self::ENCODED_LEN,
21653 __tmp.remaining(),
21654 )
21655 }
21656 __tmp.put_u64_le(self.time_usec);
21657 for val in &self.distances {
21658 __tmp.put_u16_le(*val);
21659 }
21660 __tmp.put_u16_le(self.min_distance);
21661 __tmp.put_u16_le(self.max_distance);
21662 __tmp.put_u8(self.sensor_type as u8);
21663 __tmp.put_u8(self.increment);
21664 if matches!(version, MavlinkVersion::V2) {
21665 __tmp.put_f32_le(self.increment_f);
21666 __tmp.put_f32_le(self.angle_offset);
21667 __tmp.put_u8(self.frame as u8);
21668 let len = __tmp.len();
21669 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21670 } else {
21671 __tmp.len()
21672 }
21673 }
21674}
21675#[doc = "Odometry message to communicate odometry information with an external interface. Fits ROS REP 147 standard for aerial vehicles (<http://www.ros.org/reps/rep-0147.html>)."]
21676#[doc = ""]
21677#[doc = "ID: 331"]
21678#[derive(Debug, Clone, PartialEq)]
21679#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21680#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21681#[cfg_attr(feature = "ts", derive(TS))]
21682#[cfg_attr(feature = "ts", ts(export))]
21683pub struct ODOMETRY_DATA {
21684 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
21685 pub time_usec: u64,
21686 #[doc = "X Position"]
21687 pub x: f32,
21688 #[doc = "Y Position"]
21689 pub y: f32,
21690 #[doc = "Z Position"]
21691 pub z: f32,
21692 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)"]
21693 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21694 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21695 pub q: [f32; 4],
21696 #[doc = "X linear speed"]
21697 pub vx: f32,
21698 #[doc = "Y linear speed"]
21699 pub vy: f32,
21700 #[doc = "Z linear speed"]
21701 pub vz: f32,
21702 #[doc = "Roll angular speed"]
21703 pub rollspeed: f32,
21704 #[doc = "Pitch angular speed"]
21705 pub pitchspeed: f32,
21706 #[doc = "Yaw angular speed"]
21707 pub yawspeed: f32,
21708 #[doc = "Row-major representation of a 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
21709 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21710 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21711 pub pose_covariance: [f32; 21],
21712 #[doc = "Row-major representation of a 6x6 velocity cross-covariance matrix upper right triangle (states: vx, vy, vz, rollspeed, pitchspeed, yawspeed; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
21713 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21714 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21715 pub velocity_covariance: [f32; 21],
21716 #[doc = "Coordinate frame of reference for the pose data."]
21717 pub frame_id: MavFrame,
21718 #[doc = "Coordinate frame of reference for the velocity in free space (twist) data."]
21719 pub child_frame_id: MavFrame,
21720 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
21721 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21722 pub reset_counter: u8,
21723 #[doc = "Type of estimator that is providing the odometry."]
21724 #[cfg_attr(feature = "serde", serde(default))]
21725 pub estimator_type: MavEstimatorType,
21726 #[doc = "Optional odometry quality metric as a percentage. -1 = odometry has failed, 0 = unknown/unset quality, 1 = worst quality, 100 = best quality"]
21727 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21728 pub quality: i8,
21729}
21730impl ODOMETRY_DATA {
21731 pub const ENCODED_LEN: usize = 233usize;
21732 pub const DEFAULT: Self = Self {
21733 time_usec: 0_u64,
21734 x: 0.0_f32,
21735 y: 0.0_f32,
21736 z: 0.0_f32,
21737 q: [0.0_f32; 4usize],
21738 vx: 0.0_f32,
21739 vy: 0.0_f32,
21740 vz: 0.0_f32,
21741 rollspeed: 0.0_f32,
21742 pitchspeed: 0.0_f32,
21743 yawspeed: 0.0_f32,
21744 pose_covariance: [0.0_f32; 21usize],
21745 velocity_covariance: [0.0_f32; 21usize],
21746 frame_id: MavFrame::DEFAULT,
21747 child_frame_id: MavFrame::DEFAULT,
21748 reset_counter: 0_u8,
21749 estimator_type: MavEstimatorType::DEFAULT,
21750 quality: 0_i8,
21751 };
21752 #[cfg(feature = "arbitrary")]
21753 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21754 use arbitrary::{Arbitrary, Unstructured};
21755 let mut buf = [0u8; 1024];
21756 rng.fill_bytes(&mut buf);
21757 let mut unstructured = Unstructured::new(&buf);
21758 Self::arbitrary(&mut unstructured).unwrap_or_default()
21759 }
21760}
21761impl Default for ODOMETRY_DATA {
21762 fn default() -> Self {
21763 Self::DEFAULT.clone()
21764 }
21765}
21766impl MessageData for ODOMETRY_DATA {
21767 type Message = MavMessage;
21768 const ID: u32 = 331u32;
21769 const NAME: &'static str = "ODOMETRY";
21770 const EXTRA_CRC: u8 = 91u8;
21771 const ENCODED_LEN: usize = 233usize;
21772 fn deser(
21773 _version: MavlinkVersion,
21774 __input: &[u8],
21775 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21776 let avail_len = __input.len();
21777 let mut payload_buf = [0; Self::ENCODED_LEN];
21778 let mut buf = if avail_len < Self::ENCODED_LEN {
21779 payload_buf[0..avail_len].copy_from_slice(__input);
21780 Bytes::new(&payload_buf)
21781 } else {
21782 Bytes::new(__input)
21783 };
21784 let mut __struct = Self::default();
21785 __struct.time_usec = buf.get_u64_le();
21786 __struct.x = buf.get_f32_le();
21787 __struct.y = buf.get_f32_le();
21788 __struct.z = buf.get_f32_le();
21789 for v in &mut __struct.q {
21790 let val = buf.get_f32_le();
21791 *v = val;
21792 }
21793 __struct.vx = buf.get_f32_le();
21794 __struct.vy = buf.get_f32_le();
21795 __struct.vz = buf.get_f32_le();
21796 __struct.rollspeed = buf.get_f32_le();
21797 __struct.pitchspeed = buf.get_f32_le();
21798 __struct.yawspeed = buf.get_f32_le();
21799 for v in &mut __struct.pose_covariance {
21800 let val = buf.get_f32_le();
21801 *v = val;
21802 }
21803 for v in &mut __struct.velocity_covariance {
21804 let val = buf.get_f32_le();
21805 *v = val;
21806 }
21807 let tmp = buf.get_u8();
21808 __struct.frame_id =
21809 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21810 enum_type: "MavFrame",
21811 value: tmp as u32,
21812 })?;
21813 let tmp = buf.get_u8();
21814 __struct.child_frame_id =
21815 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21816 enum_type: "MavFrame",
21817 value: tmp as u32,
21818 })?;
21819 __struct.reset_counter = buf.get_u8();
21820 let tmp = buf.get_u8();
21821 __struct.estimator_type =
21822 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21823 enum_type: "MavEstimatorType",
21824 value: tmp as u32,
21825 })?;
21826 __struct.quality = buf.get_i8();
21827 Ok(__struct)
21828 }
21829 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21830 let mut __tmp = BytesMut::new(bytes);
21831 #[allow(clippy::absurd_extreme_comparisons)]
21832 #[allow(unused_comparisons)]
21833 if __tmp.remaining() < Self::ENCODED_LEN {
21834 panic!(
21835 "buffer is too small (need {} bytes, but got {})",
21836 Self::ENCODED_LEN,
21837 __tmp.remaining(),
21838 )
21839 }
21840 __tmp.put_u64_le(self.time_usec);
21841 __tmp.put_f32_le(self.x);
21842 __tmp.put_f32_le(self.y);
21843 __tmp.put_f32_le(self.z);
21844 for val in &self.q {
21845 __tmp.put_f32_le(*val);
21846 }
21847 __tmp.put_f32_le(self.vx);
21848 __tmp.put_f32_le(self.vy);
21849 __tmp.put_f32_le(self.vz);
21850 __tmp.put_f32_le(self.rollspeed);
21851 __tmp.put_f32_le(self.pitchspeed);
21852 __tmp.put_f32_le(self.yawspeed);
21853 for val in &self.pose_covariance {
21854 __tmp.put_f32_le(*val);
21855 }
21856 for val in &self.velocity_covariance {
21857 __tmp.put_f32_le(*val);
21858 }
21859 __tmp.put_u8(self.frame_id as u8);
21860 __tmp.put_u8(self.child_frame_id as u8);
21861 if matches!(version, MavlinkVersion::V2) {
21862 __tmp.put_u8(self.reset_counter);
21863 __tmp.put_u8(self.estimator_type as u8);
21864 __tmp.put_i8(self.quality);
21865 let len = __tmp.len();
21866 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21867 } else {
21868 __tmp.len()
21869 }
21870 }
21871}
21872#[doc = "Hardware status sent by an onboard computer."]
21873#[doc = ""]
21874#[doc = "ID: 390"]
21875#[derive(Debug, Clone, PartialEq)]
21876#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21877#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21878#[cfg_attr(feature = "ts", derive(TS))]
21879#[cfg_attr(feature = "ts", ts(export))]
21880pub struct ONBOARD_COMPUTER_STATUS_DATA {
21881 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
21882 pub time_usec: u64,
21883 #[doc = "Time since system boot."]
21884 pub uptime: u32,
21885 #[doc = "Amount of used RAM on the component system. A value of UINT32_MAX implies the field is unused."]
21886 pub ram_usage: u32,
21887 #[doc = "Total amount of RAM on the component system. A value of UINT32_MAX implies the field is unused."]
21888 pub ram_total: u32,
21889 #[doc = "Storage type: 0: HDD, 1: SSD, 2: EMMC, 3: SD card (non-removable), 4: SD card (removable). A value of UINT32_MAX implies the field is unused."]
21890 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21891 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21892 pub storage_type: [u32; 4],
21893 #[doc = "Amount of used storage space on the component system. A value of UINT32_MAX implies the field is unused."]
21894 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21895 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21896 pub storage_usage: [u32; 4],
21897 #[doc = "Total amount of storage space on the component system. A value of UINT32_MAX implies the field is unused."]
21898 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21899 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21900 pub storage_total: [u32; 4],
21901 #[doc = "Link type: 0-9: UART, 10-19: Wired network, 20-29: Wifi, 30-39: Point-to-point proprietary, 40-49: Mesh proprietary"]
21902 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21903 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21904 pub link_type: [u32; 6],
21905 #[doc = "Network traffic from the component system. A value of UINT32_MAX implies the field is unused."]
21906 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21907 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21908 pub link_tx_rate: [u32; 6],
21909 #[doc = "Network traffic to the component system. A value of UINT32_MAX implies the field is unused."]
21910 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21911 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21912 pub link_rx_rate: [u32; 6],
21913 #[doc = "Network capacity from the component system. A value of UINT32_MAX implies the field is unused."]
21914 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21915 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21916 pub link_tx_max: [u32; 6],
21917 #[doc = "Network capacity to the component system. A value of UINT32_MAX implies the field is unused."]
21918 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21919 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21920 pub link_rx_max: [u32; 6],
21921 #[doc = "Fan speeds. A value of INT16_MAX implies the field is unused."]
21922 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21923 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21924 pub fan_speed: [i16; 4],
21925 #[doc = "Type of the onboard computer: 0: Mission computer primary, 1: Mission computer backup 1, 2: Mission computer backup 2, 3: Compute node, 4-5: Compute spares, 6-9: Payload computers."]
21926 pub mavtype: u8,
21927 #[doc = "CPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused."]
21928 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21929 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21930 pub cpu_cores: [u8; 8],
21931 #[doc = "Combined CPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused."]
21932 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21933 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21934 pub cpu_combined: [u8; 10],
21935 #[doc = "GPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused."]
21936 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21937 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21938 pub gpu_cores: [u8; 4],
21939 #[doc = "Combined GPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused."]
21940 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21941 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21942 pub gpu_combined: [u8; 10],
21943 #[doc = "Temperature of the board. A value of INT8_MAX implies the field is unused."]
21944 pub temperature_board: i8,
21945 #[doc = "Temperature of the CPU core. A value of INT8_MAX implies the field is unused."]
21946 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21947 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21948 pub temperature_core: [i8; 8],
21949}
21950impl ONBOARD_COMPUTER_STATUS_DATA {
21951 pub const ENCODED_LEN: usize = 238usize;
21952 pub const DEFAULT: Self = Self {
21953 time_usec: 0_u64,
21954 uptime: 0_u32,
21955 ram_usage: 0_u32,
21956 ram_total: 0_u32,
21957 storage_type: [0_u32; 4usize],
21958 storage_usage: [0_u32; 4usize],
21959 storage_total: [0_u32; 4usize],
21960 link_type: [0_u32; 6usize],
21961 link_tx_rate: [0_u32; 6usize],
21962 link_rx_rate: [0_u32; 6usize],
21963 link_tx_max: [0_u32; 6usize],
21964 link_rx_max: [0_u32; 6usize],
21965 fan_speed: [0_i16; 4usize],
21966 mavtype: 0_u8,
21967 cpu_cores: [0_u8; 8usize],
21968 cpu_combined: [0_u8; 10usize],
21969 gpu_cores: [0_u8; 4usize],
21970 gpu_combined: [0_u8; 10usize],
21971 temperature_board: 0_i8,
21972 temperature_core: [0_i8; 8usize],
21973 };
21974 #[cfg(feature = "arbitrary")]
21975 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21976 use arbitrary::{Arbitrary, Unstructured};
21977 let mut buf = [0u8; 1024];
21978 rng.fill_bytes(&mut buf);
21979 let mut unstructured = Unstructured::new(&buf);
21980 Self::arbitrary(&mut unstructured).unwrap_or_default()
21981 }
21982}
21983impl Default for ONBOARD_COMPUTER_STATUS_DATA {
21984 fn default() -> Self {
21985 Self::DEFAULT.clone()
21986 }
21987}
21988impl MessageData for ONBOARD_COMPUTER_STATUS_DATA {
21989 type Message = MavMessage;
21990 const ID: u32 = 390u32;
21991 const NAME: &'static str = "ONBOARD_COMPUTER_STATUS";
21992 const EXTRA_CRC: u8 = 156u8;
21993 const ENCODED_LEN: usize = 238usize;
21994 fn deser(
21995 _version: MavlinkVersion,
21996 __input: &[u8],
21997 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21998 let avail_len = __input.len();
21999 let mut payload_buf = [0; Self::ENCODED_LEN];
22000 let mut buf = if avail_len < Self::ENCODED_LEN {
22001 payload_buf[0..avail_len].copy_from_slice(__input);
22002 Bytes::new(&payload_buf)
22003 } else {
22004 Bytes::new(__input)
22005 };
22006 let mut __struct = Self::default();
22007 __struct.time_usec = buf.get_u64_le();
22008 __struct.uptime = buf.get_u32_le();
22009 __struct.ram_usage = buf.get_u32_le();
22010 __struct.ram_total = buf.get_u32_le();
22011 for v in &mut __struct.storage_type {
22012 let val = buf.get_u32_le();
22013 *v = val;
22014 }
22015 for v in &mut __struct.storage_usage {
22016 let val = buf.get_u32_le();
22017 *v = val;
22018 }
22019 for v in &mut __struct.storage_total {
22020 let val = buf.get_u32_le();
22021 *v = val;
22022 }
22023 for v in &mut __struct.link_type {
22024 let val = buf.get_u32_le();
22025 *v = val;
22026 }
22027 for v in &mut __struct.link_tx_rate {
22028 let val = buf.get_u32_le();
22029 *v = val;
22030 }
22031 for v in &mut __struct.link_rx_rate {
22032 let val = buf.get_u32_le();
22033 *v = val;
22034 }
22035 for v in &mut __struct.link_tx_max {
22036 let val = buf.get_u32_le();
22037 *v = val;
22038 }
22039 for v in &mut __struct.link_rx_max {
22040 let val = buf.get_u32_le();
22041 *v = val;
22042 }
22043 for v in &mut __struct.fan_speed {
22044 let val = buf.get_i16_le();
22045 *v = val;
22046 }
22047 __struct.mavtype = buf.get_u8();
22048 for v in &mut __struct.cpu_cores {
22049 let val = buf.get_u8();
22050 *v = val;
22051 }
22052 for v in &mut __struct.cpu_combined {
22053 let val = buf.get_u8();
22054 *v = val;
22055 }
22056 for v in &mut __struct.gpu_cores {
22057 let val = buf.get_u8();
22058 *v = val;
22059 }
22060 for v in &mut __struct.gpu_combined {
22061 let val = buf.get_u8();
22062 *v = val;
22063 }
22064 __struct.temperature_board = buf.get_i8();
22065 for v in &mut __struct.temperature_core {
22066 let val = buf.get_i8();
22067 *v = val;
22068 }
22069 Ok(__struct)
22070 }
22071 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22072 let mut __tmp = BytesMut::new(bytes);
22073 #[allow(clippy::absurd_extreme_comparisons)]
22074 #[allow(unused_comparisons)]
22075 if __tmp.remaining() < Self::ENCODED_LEN {
22076 panic!(
22077 "buffer is too small (need {} bytes, but got {})",
22078 Self::ENCODED_LEN,
22079 __tmp.remaining(),
22080 )
22081 }
22082 __tmp.put_u64_le(self.time_usec);
22083 __tmp.put_u32_le(self.uptime);
22084 __tmp.put_u32_le(self.ram_usage);
22085 __tmp.put_u32_le(self.ram_total);
22086 for val in &self.storage_type {
22087 __tmp.put_u32_le(*val);
22088 }
22089 for val in &self.storage_usage {
22090 __tmp.put_u32_le(*val);
22091 }
22092 for val in &self.storage_total {
22093 __tmp.put_u32_le(*val);
22094 }
22095 for val in &self.link_type {
22096 __tmp.put_u32_le(*val);
22097 }
22098 for val in &self.link_tx_rate {
22099 __tmp.put_u32_le(*val);
22100 }
22101 for val in &self.link_rx_rate {
22102 __tmp.put_u32_le(*val);
22103 }
22104 for val in &self.link_tx_max {
22105 __tmp.put_u32_le(*val);
22106 }
22107 for val in &self.link_rx_max {
22108 __tmp.put_u32_le(*val);
22109 }
22110 for val in &self.fan_speed {
22111 __tmp.put_i16_le(*val);
22112 }
22113 __tmp.put_u8(self.mavtype);
22114 for val in &self.cpu_cores {
22115 __tmp.put_u8(*val);
22116 }
22117 for val in &self.cpu_combined {
22118 __tmp.put_u8(*val);
22119 }
22120 for val in &self.gpu_cores {
22121 __tmp.put_u8(*val);
22122 }
22123 for val in &self.gpu_combined {
22124 __tmp.put_u8(*val);
22125 }
22126 __tmp.put_i8(self.temperature_board);
22127 for val in &self.temperature_core {
22128 __tmp.put_i8(*val);
22129 }
22130 if matches!(version, MavlinkVersion::V2) {
22131 let len = __tmp.len();
22132 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22133 } else {
22134 __tmp.len()
22135 }
22136 }
22137}
22138#[doc = "Transmitter (remote ID system) is enabled and ready to start sending location and other required information. This is streamed by transmitter. A flight controller uses it as a condition to arm."]
22139#[doc = ""]
22140#[doc = "ID: 12918"]
22141#[derive(Debug, Clone, PartialEq)]
22142#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22143#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22144#[cfg_attr(feature = "ts", derive(TS))]
22145#[cfg_attr(feature = "ts", ts(export))]
22146pub struct OPEN_DRONE_ID_ARM_STATUS_DATA {
22147 #[doc = "Status level indicating if arming is allowed."]
22148 pub status: MavOdidArmStatus,
22149 #[doc = "Text error message, should be empty if status is good to arm. Fill with nulls in unused portion."]
22150 #[cfg_attr(
22151 feature = "serde",
22152 serde(
22153 serialize_with = "crate::nulstr::serialize::<_, 50>",
22154 deserialize_with = "crate::nulstr::deserialize::<_, 50>"
22155 )
22156 )]
22157 #[cfg_attr(feature = "ts", ts(type = "string"))]
22158 pub error: [u8; 50],
22159}
22160impl OPEN_DRONE_ID_ARM_STATUS_DATA {
22161 pub const ENCODED_LEN: usize = 51usize;
22162 pub const DEFAULT: Self = Self {
22163 status: MavOdidArmStatus::DEFAULT,
22164 error: [0_u8; 50usize],
22165 };
22166 #[cfg(feature = "arbitrary")]
22167 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22168 use arbitrary::{Arbitrary, Unstructured};
22169 let mut buf = [0u8; 1024];
22170 rng.fill_bytes(&mut buf);
22171 let mut unstructured = Unstructured::new(&buf);
22172 Self::arbitrary(&mut unstructured).unwrap_or_default()
22173 }
22174}
22175impl Default for OPEN_DRONE_ID_ARM_STATUS_DATA {
22176 fn default() -> Self {
22177 Self::DEFAULT.clone()
22178 }
22179}
22180impl MessageData for OPEN_DRONE_ID_ARM_STATUS_DATA {
22181 type Message = MavMessage;
22182 const ID: u32 = 12918u32;
22183 const NAME: &'static str = "OPEN_DRONE_ID_ARM_STATUS";
22184 const EXTRA_CRC: u8 = 139u8;
22185 const ENCODED_LEN: usize = 51usize;
22186 fn deser(
22187 _version: MavlinkVersion,
22188 __input: &[u8],
22189 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22190 let avail_len = __input.len();
22191 let mut payload_buf = [0; Self::ENCODED_LEN];
22192 let mut buf = if avail_len < Self::ENCODED_LEN {
22193 payload_buf[0..avail_len].copy_from_slice(__input);
22194 Bytes::new(&payload_buf)
22195 } else {
22196 Bytes::new(__input)
22197 };
22198 let mut __struct = Self::default();
22199 let tmp = buf.get_u8();
22200 __struct.status =
22201 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22202 enum_type: "MavOdidArmStatus",
22203 value: tmp as u32,
22204 })?;
22205 for v in &mut __struct.error {
22206 let val = buf.get_u8();
22207 *v = val;
22208 }
22209 Ok(__struct)
22210 }
22211 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22212 let mut __tmp = BytesMut::new(bytes);
22213 #[allow(clippy::absurd_extreme_comparisons)]
22214 #[allow(unused_comparisons)]
22215 if __tmp.remaining() < Self::ENCODED_LEN {
22216 panic!(
22217 "buffer is too small (need {} bytes, but got {})",
22218 Self::ENCODED_LEN,
22219 __tmp.remaining(),
22220 )
22221 }
22222 __tmp.put_u8(self.status as u8);
22223 for val in &self.error {
22224 __tmp.put_u8(*val);
22225 }
22226 if matches!(version, MavlinkVersion::V2) {
22227 let len = __tmp.len();
22228 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22229 } else {
22230 __tmp.len()
22231 }
22232 }
22233}
22234#[doc = "Data for filling the OpenDroneID Authentication message. The Authentication Message defines a field that can provide a means of authenticity for the identity of the UAS (Unmanned Aircraft System). The Authentication message can have two different formats. For data page 0, the fields PageCount, Length and TimeStamp are present and AuthData is only 17 bytes. For data page 1 through 15, PageCount, Length and TimeStamp are not present and the size of AuthData is 23 bytes."]
22235#[doc = ""]
22236#[doc = "ID: 12902"]
22237#[derive(Debug, Clone, PartialEq)]
22238#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22239#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22240#[cfg_attr(feature = "ts", derive(TS))]
22241#[cfg_attr(feature = "ts", ts(export))]
22242pub struct OPEN_DRONE_ID_AUTHENTICATION_DATA {
22243 #[doc = "This field is only present for page 0. 32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
22244 pub timestamp: u32,
22245 #[doc = "System ID (0 for broadcast)."]
22246 pub target_system: u8,
22247 #[doc = "Component ID (0 for broadcast)."]
22248 pub target_component: u8,
22249 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22250 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22251 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22252 pub id_or_mac: [u8; 20],
22253 #[doc = "Indicates the type of authentication."]
22254 pub authentication_type: MavOdidAuthType,
22255 #[doc = "Allowed range is 0 - 15."]
22256 pub data_page: u8,
22257 #[doc = "This field is only present for page 0. Allowed range is 0 - 15. See the description of struct ODID_Auth_data at <https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h>."]
22258 pub last_page_index: u8,
22259 #[doc = "This field is only present for page 0. Total bytes of authentication_data from all data pages. See the description of struct ODID_Auth_data at <https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h>."]
22260 pub length: u8,
22261 #[doc = "Opaque authentication data. For page 0, the size is only 17 bytes. For other pages, the size is 23 bytes. Shall be filled with nulls in the unused portion of the field."]
22262 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22263 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22264 pub authentication_data: [u8; 23],
22265}
22266impl OPEN_DRONE_ID_AUTHENTICATION_DATA {
22267 pub const ENCODED_LEN: usize = 53usize;
22268 pub const DEFAULT: Self = Self {
22269 timestamp: 0_u32,
22270 target_system: 0_u8,
22271 target_component: 0_u8,
22272 id_or_mac: [0_u8; 20usize],
22273 authentication_type: MavOdidAuthType::DEFAULT,
22274 data_page: 0_u8,
22275 last_page_index: 0_u8,
22276 length: 0_u8,
22277 authentication_data: [0_u8; 23usize],
22278 };
22279 #[cfg(feature = "arbitrary")]
22280 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22281 use arbitrary::{Arbitrary, Unstructured};
22282 let mut buf = [0u8; 1024];
22283 rng.fill_bytes(&mut buf);
22284 let mut unstructured = Unstructured::new(&buf);
22285 Self::arbitrary(&mut unstructured).unwrap_or_default()
22286 }
22287}
22288impl Default for OPEN_DRONE_ID_AUTHENTICATION_DATA {
22289 fn default() -> Self {
22290 Self::DEFAULT.clone()
22291 }
22292}
22293impl MessageData for OPEN_DRONE_ID_AUTHENTICATION_DATA {
22294 type Message = MavMessage;
22295 const ID: u32 = 12902u32;
22296 const NAME: &'static str = "OPEN_DRONE_ID_AUTHENTICATION";
22297 const EXTRA_CRC: u8 = 140u8;
22298 const ENCODED_LEN: usize = 53usize;
22299 fn deser(
22300 _version: MavlinkVersion,
22301 __input: &[u8],
22302 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22303 let avail_len = __input.len();
22304 let mut payload_buf = [0; Self::ENCODED_LEN];
22305 let mut buf = if avail_len < Self::ENCODED_LEN {
22306 payload_buf[0..avail_len].copy_from_slice(__input);
22307 Bytes::new(&payload_buf)
22308 } else {
22309 Bytes::new(__input)
22310 };
22311 let mut __struct = Self::default();
22312 __struct.timestamp = buf.get_u32_le();
22313 __struct.target_system = buf.get_u8();
22314 __struct.target_component = buf.get_u8();
22315 for v in &mut __struct.id_or_mac {
22316 let val = buf.get_u8();
22317 *v = val;
22318 }
22319 let tmp = buf.get_u8();
22320 __struct.authentication_type =
22321 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22322 enum_type: "MavOdidAuthType",
22323 value: tmp as u32,
22324 })?;
22325 __struct.data_page = buf.get_u8();
22326 __struct.last_page_index = buf.get_u8();
22327 __struct.length = buf.get_u8();
22328 for v in &mut __struct.authentication_data {
22329 let val = buf.get_u8();
22330 *v = val;
22331 }
22332 Ok(__struct)
22333 }
22334 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22335 let mut __tmp = BytesMut::new(bytes);
22336 #[allow(clippy::absurd_extreme_comparisons)]
22337 #[allow(unused_comparisons)]
22338 if __tmp.remaining() < Self::ENCODED_LEN {
22339 panic!(
22340 "buffer is too small (need {} bytes, but got {})",
22341 Self::ENCODED_LEN,
22342 __tmp.remaining(),
22343 )
22344 }
22345 __tmp.put_u32_le(self.timestamp);
22346 __tmp.put_u8(self.target_system);
22347 __tmp.put_u8(self.target_component);
22348 for val in &self.id_or_mac {
22349 __tmp.put_u8(*val);
22350 }
22351 __tmp.put_u8(self.authentication_type as u8);
22352 __tmp.put_u8(self.data_page);
22353 __tmp.put_u8(self.last_page_index);
22354 __tmp.put_u8(self.length);
22355 for val in &self.authentication_data {
22356 __tmp.put_u8(*val);
22357 }
22358 if matches!(version, MavlinkVersion::V2) {
22359 let len = __tmp.len();
22360 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22361 } else {
22362 __tmp.len()
22363 }
22364 }
22365}
22366#[doc = "Data for filling the OpenDroneID Basic ID message. This and the below messages are primarily meant for feeding data to/from an OpenDroneID implementation. E.g. <https://github.com/opendroneid/opendroneid-core-c>. These messages are compatible with the ASTM F3411 Remote ID standard and the ASD-STAN prEN 4709-002 Direct Remote ID standard. Additional information and usage of these messages is documented at <https://mavlink.io/en/services/opendroneid.html>."]
22367#[doc = ""]
22368#[doc = "ID: 12900"]
22369#[derive(Debug, Clone, PartialEq)]
22370#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22371#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22372#[cfg_attr(feature = "ts", derive(TS))]
22373#[cfg_attr(feature = "ts", ts(export))]
22374pub struct OPEN_DRONE_ID_BASIC_ID_DATA {
22375 #[doc = "System ID (0 for broadcast)."]
22376 pub target_system: u8,
22377 #[doc = "Component ID (0 for broadcast)."]
22378 pub target_component: u8,
22379 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22380 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22381 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22382 pub id_or_mac: [u8; 20],
22383 #[doc = "Indicates the format for the uas_id field of this message."]
22384 pub id_type: MavOdidIdType,
22385 #[doc = "Indicates the type of UA (Unmanned Aircraft)."]
22386 pub ua_type: MavOdidUaType,
22387 #[doc = "UAS (Unmanned Aircraft System) ID following the format specified by id_type. Shall be filled with nulls in the unused portion of the field."]
22388 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22389 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22390 pub uas_id: [u8; 20],
22391}
22392impl OPEN_DRONE_ID_BASIC_ID_DATA {
22393 pub const ENCODED_LEN: usize = 44usize;
22394 pub const DEFAULT: Self = Self {
22395 target_system: 0_u8,
22396 target_component: 0_u8,
22397 id_or_mac: [0_u8; 20usize],
22398 id_type: MavOdidIdType::DEFAULT,
22399 ua_type: MavOdidUaType::DEFAULT,
22400 uas_id: [0_u8; 20usize],
22401 };
22402 #[cfg(feature = "arbitrary")]
22403 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22404 use arbitrary::{Arbitrary, Unstructured};
22405 let mut buf = [0u8; 1024];
22406 rng.fill_bytes(&mut buf);
22407 let mut unstructured = Unstructured::new(&buf);
22408 Self::arbitrary(&mut unstructured).unwrap_or_default()
22409 }
22410}
22411impl Default for OPEN_DRONE_ID_BASIC_ID_DATA {
22412 fn default() -> Self {
22413 Self::DEFAULT.clone()
22414 }
22415}
22416impl MessageData for OPEN_DRONE_ID_BASIC_ID_DATA {
22417 type Message = MavMessage;
22418 const ID: u32 = 12900u32;
22419 const NAME: &'static str = "OPEN_DRONE_ID_BASIC_ID";
22420 const EXTRA_CRC: u8 = 114u8;
22421 const ENCODED_LEN: usize = 44usize;
22422 fn deser(
22423 _version: MavlinkVersion,
22424 __input: &[u8],
22425 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22426 let avail_len = __input.len();
22427 let mut payload_buf = [0; Self::ENCODED_LEN];
22428 let mut buf = if avail_len < Self::ENCODED_LEN {
22429 payload_buf[0..avail_len].copy_from_slice(__input);
22430 Bytes::new(&payload_buf)
22431 } else {
22432 Bytes::new(__input)
22433 };
22434 let mut __struct = Self::default();
22435 __struct.target_system = buf.get_u8();
22436 __struct.target_component = buf.get_u8();
22437 for v in &mut __struct.id_or_mac {
22438 let val = buf.get_u8();
22439 *v = val;
22440 }
22441 let tmp = buf.get_u8();
22442 __struct.id_type =
22443 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22444 enum_type: "MavOdidIdType",
22445 value: tmp as u32,
22446 })?;
22447 let tmp = buf.get_u8();
22448 __struct.ua_type =
22449 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22450 enum_type: "MavOdidUaType",
22451 value: tmp as u32,
22452 })?;
22453 for v in &mut __struct.uas_id {
22454 let val = buf.get_u8();
22455 *v = val;
22456 }
22457 Ok(__struct)
22458 }
22459 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22460 let mut __tmp = BytesMut::new(bytes);
22461 #[allow(clippy::absurd_extreme_comparisons)]
22462 #[allow(unused_comparisons)]
22463 if __tmp.remaining() < Self::ENCODED_LEN {
22464 panic!(
22465 "buffer is too small (need {} bytes, but got {})",
22466 Self::ENCODED_LEN,
22467 __tmp.remaining(),
22468 )
22469 }
22470 __tmp.put_u8(self.target_system);
22471 __tmp.put_u8(self.target_component);
22472 for val in &self.id_or_mac {
22473 __tmp.put_u8(*val);
22474 }
22475 __tmp.put_u8(self.id_type as u8);
22476 __tmp.put_u8(self.ua_type as u8);
22477 for val in &self.uas_id {
22478 __tmp.put_u8(*val);
22479 }
22480 if matches!(version, MavlinkVersion::V2) {
22481 let len = __tmp.len();
22482 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22483 } else {
22484 __tmp.len()
22485 }
22486 }
22487}
22488#[doc = "Data for filling the OpenDroneID Location message. The float data types are 32-bit IEEE 754. The Location message provides the location, altitude, direction and speed of the aircraft."]
22489#[doc = ""]
22490#[doc = "ID: 12901"]
22491#[derive(Debug, Clone, PartialEq)]
22492#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22493#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22494#[cfg_attr(feature = "ts", derive(TS))]
22495#[cfg_attr(feature = "ts", ts(export))]
22496pub struct OPEN_DRONE_ID_LOCATION_DATA {
22497 #[doc = "Current latitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon)."]
22498 pub latitude: i32,
22499 #[doc = "Current longitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon)."]
22500 pub longitude: i32,
22501 #[doc = "The altitude calculated from the barometric pressue. Reference is against 29.92inHg or 1013.2mb. If unknown: -1000 m."]
22502 pub altitude_barometric: f32,
22503 #[doc = "The geodetic altitude as defined by WGS84. If unknown: -1000 m."]
22504 pub altitude_geodetic: f32,
22505 #[doc = "The current height of the unmanned aircraft above the take-off location or the ground as indicated by height_reference. If unknown: -1000 m."]
22506 pub height: f32,
22507 #[doc = "Seconds after the full hour with reference to UTC time. Typically the GPS outputs a time-of-week value in milliseconds. First convert that to UTC and then convert for this field using ((float) (time_week_ms % (60*60*1000))) / 1000. If unknown: 0xFFFF."]
22508 pub timestamp: f32,
22509 #[doc = "Direction over ground (not heading, but direction of movement) measured clockwise from true North: 0 - 35999 centi-degrees. If unknown: 36100 centi-degrees."]
22510 pub direction: u16,
22511 #[doc = "Ground speed. Positive only. If unknown: 25500 cm/s. If speed is larger than 25425 cm/s, use 25425 cm/s."]
22512 pub speed_horizontal: u16,
22513 #[doc = "The vertical speed. Up is positive. If unknown: 6300 cm/s. If speed is larger than 6200 cm/s, use 6200 cm/s. If lower than -6200 cm/s, use -6200 cm/s."]
22514 pub speed_vertical: i16,
22515 #[doc = "System ID (0 for broadcast)."]
22516 pub target_system: u8,
22517 #[doc = "Component ID (0 for broadcast)."]
22518 pub target_component: u8,
22519 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22520 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22521 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22522 pub id_or_mac: [u8; 20],
22523 #[doc = "Indicates whether the unmanned aircraft is on the ground or in the air."]
22524 pub status: MavOdidStatus,
22525 #[doc = "Indicates the reference point for the height field."]
22526 pub height_reference: MavOdidHeightRef,
22527 #[doc = "The accuracy of the horizontal position."]
22528 pub horizontal_accuracy: MavOdidHorAcc,
22529 #[doc = "The accuracy of the vertical position."]
22530 pub vertical_accuracy: MavOdidVerAcc,
22531 #[doc = "The accuracy of the barometric altitude."]
22532 pub barometer_accuracy: MavOdidVerAcc,
22533 #[doc = "The accuracy of the horizontal and vertical speed."]
22534 pub speed_accuracy: MavOdidSpeedAcc,
22535 #[doc = "The accuracy of the timestamps."]
22536 pub timestamp_accuracy: MavOdidTimeAcc,
22537}
22538impl OPEN_DRONE_ID_LOCATION_DATA {
22539 pub const ENCODED_LEN: usize = 59usize;
22540 pub const DEFAULT: Self = Self {
22541 latitude: 0_i32,
22542 longitude: 0_i32,
22543 altitude_barometric: 0.0_f32,
22544 altitude_geodetic: 0.0_f32,
22545 height: 0.0_f32,
22546 timestamp: 0.0_f32,
22547 direction: 0_u16,
22548 speed_horizontal: 0_u16,
22549 speed_vertical: 0_i16,
22550 target_system: 0_u8,
22551 target_component: 0_u8,
22552 id_or_mac: [0_u8; 20usize],
22553 status: MavOdidStatus::DEFAULT,
22554 height_reference: MavOdidHeightRef::DEFAULT,
22555 horizontal_accuracy: MavOdidHorAcc::DEFAULT,
22556 vertical_accuracy: MavOdidVerAcc::DEFAULT,
22557 barometer_accuracy: MavOdidVerAcc::DEFAULT,
22558 speed_accuracy: MavOdidSpeedAcc::DEFAULT,
22559 timestamp_accuracy: MavOdidTimeAcc::DEFAULT,
22560 };
22561 #[cfg(feature = "arbitrary")]
22562 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22563 use arbitrary::{Arbitrary, Unstructured};
22564 let mut buf = [0u8; 1024];
22565 rng.fill_bytes(&mut buf);
22566 let mut unstructured = Unstructured::new(&buf);
22567 Self::arbitrary(&mut unstructured).unwrap_or_default()
22568 }
22569}
22570impl Default for OPEN_DRONE_ID_LOCATION_DATA {
22571 fn default() -> Self {
22572 Self::DEFAULT.clone()
22573 }
22574}
22575impl MessageData for OPEN_DRONE_ID_LOCATION_DATA {
22576 type Message = MavMessage;
22577 const ID: u32 = 12901u32;
22578 const NAME: &'static str = "OPEN_DRONE_ID_LOCATION";
22579 const EXTRA_CRC: u8 = 254u8;
22580 const ENCODED_LEN: usize = 59usize;
22581 fn deser(
22582 _version: MavlinkVersion,
22583 __input: &[u8],
22584 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22585 let avail_len = __input.len();
22586 let mut payload_buf = [0; Self::ENCODED_LEN];
22587 let mut buf = if avail_len < Self::ENCODED_LEN {
22588 payload_buf[0..avail_len].copy_from_slice(__input);
22589 Bytes::new(&payload_buf)
22590 } else {
22591 Bytes::new(__input)
22592 };
22593 let mut __struct = Self::default();
22594 __struct.latitude = buf.get_i32_le();
22595 __struct.longitude = buf.get_i32_le();
22596 __struct.altitude_barometric = buf.get_f32_le();
22597 __struct.altitude_geodetic = buf.get_f32_le();
22598 __struct.height = buf.get_f32_le();
22599 __struct.timestamp = buf.get_f32_le();
22600 __struct.direction = buf.get_u16_le();
22601 __struct.speed_horizontal = buf.get_u16_le();
22602 __struct.speed_vertical = buf.get_i16_le();
22603 __struct.target_system = buf.get_u8();
22604 __struct.target_component = buf.get_u8();
22605 for v in &mut __struct.id_or_mac {
22606 let val = buf.get_u8();
22607 *v = val;
22608 }
22609 let tmp = buf.get_u8();
22610 __struct.status =
22611 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22612 enum_type: "MavOdidStatus",
22613 value: tmp as u32,
22614 })?;
22615 let tmp = buf.get_u8();
22616 __struct.height_reference =
22617 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22618 enum_type: "MavOdidHeightRef",
22619 value: tmp as u32,
22620 })?;
22621 let tmp = buf.get_u8();
22622 __struct.horizontal_accuracy =
22623 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22624 enum_type: "MavOdidHorAcc",
22625 value: tmp as u32,
22626 })?;
22627 let tmp = buf.get_u8();
22628 __struct.vertical_accuracy =
22629 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22630 enum_type: "MavOdidVerAcc",
22631 value: tmp as u32,
22632 })?;
22633 let tmp = buf.get_u8();
22634 __struct.barometer_accuracy =
22635 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22636 enum_type: "MavOdidVerAcc",
22637 value: tmp as u32,
22638 })?;
22639 let tmp = buf.get_u8();
22640 __struct.speed_accuracy =
22641 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22642 enum_type: "MavOdidSpeedAcc",
22643 value: tmp as u32,
22644 })?;
22645 let tmp = buf.get_u8();
22646 __struct.timestamp_accuracy =
22647 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22648 enum_type: "MavOdidTimeAcc",
22649 value: tmp as u32,
22650 })?;
22651 Ok(__struct)
22652 }
22653 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22654 let mut __tmp = BytesMut::new(bytes);
22655 #[allow(clippy::absurd_extreme_comparisons)]
22656 #[allow(unused_comparisons)]
22657 if __tmp.remaining() < Self::ENCODED_LEN {
22658 panic!(
22659 "buffer is too small (need {} bytes, but got {})",
22660 Self::ENCODED_LEN,
22661 __tmp.remaining(),
22662 )
22663 }
22664 __tmp.put_i32_le(self.latitude);
22665 __tmp.put_i32_le(self.longitude);
22666 __tmp.put_f32_le(self.altitude_barometric);
22667 __tmp.put_f32_le(self.altitude_geodetic);
22668 __tmp.put_f32_le(self.height);
22669 __tmp.put_f32_le(self.timestamp);
22670 __tmp.put_u16_le(self.direction);
22671 __tmp.put_u16_le(self.speed_horizontal);
22672 __tmp.put_i16_le(self.speed_vertical);
22673 __tmp.put_u8(self.target_system);
22674 __tmp.put_u8(self.target_component);
22675 for val in &self.id_or_mac {
22676 __tmp.put_u8(*val);
22677 }
22678 __tmp.put_u8(self.status as u8);
22679 __tmp.put_u8(self.height_reference as u8);
22680 __tmp.put_u8(self.horizontal_accuracy as u8);
22681 __tmp.put_u8(self.vertical_accuracy as u8);
22682 __tmp.put_u8(self.barometer_accuracy as u8);
22683 __tmp.put_u8(self.speed_accuracy as u8);
22684 __tmp.put_u8(self.timestamp_accuracy as u8);
22685 if matches!(version, MavlinkVersion::V2) {
22686 let len = __tmp.len();
22687 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22688 } else {
22689 __tmp.len()
22690 }
22691 }
22692}
22693#[doc = "An OpenDroneID message pack is a container for multiple encoded OpenDroneID messages (i.e. not in the format given for the above message descriptions but after encoding into the compressed OpenDroneID byte format). Used e.g. when transmitting on Bluetooth 5.0 Long Range/Extended Advertising or on WiFi Neighbor Aware Networking or on WiFi Beacon."]
22694#[doc = ""]
22695#[doc = "ID: 12915"]
22696#[derive(Debug, Clone, PartialEq)]
22697#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22698#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22699#[cfg_attr(feature = "ts", derive(TS))]
22700#[cfg_attr(feature = "ts", ts(export))]
22701pub struct OPEN_DRONE_ID_MESSAGE_PACK_DATA {
22702 #[doc = "System ID (0 for broadcast)."]
22703 pub target_system: u8,
22704 #[doc = "Component ID (0 for broadcast)."]
22705 pub target_component: u8,
22706 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22707 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22708 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22709 pub id_or_mac: [u8; 20],
22710 #[doc = "This field must currently always be equal to 25 (bytes), since all encoded OpenDroneID messages are specified to have this length."]
22711 pub single_message_size: u8,
22712 #[doc = "Number of encoded messages in the pack (not the number of bytes). Allowed range is 1 - 9."]
22713 pub msg_pack_size: u8,
22714 #[doc = "Concatenation of encoded OpenDroneID messages. Shall be filled with nulls in the unused portion of the field."]
22715 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22716 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22717 pub messages: [u8; 225],
22718}
22719impl OPEN_DRONE_ID_MESSAGE_PACK_DATA {
22720 pub const ENCODED_LEN: usize = 249usize;
22721 pub const DEFAULT: Self = Self {
22722 target_system: 0_u8,
22723 target_component: 0_u8,
22724 id_or_mac: [0_u8; 20usize],
22725 single_message_size: 0_u8,
22726 msg_pack_size: 0_u8,
22727 messages: [0_u8; 225usize],
22728 };
22729 #[cfg(feature = "arbitrary")]
22730 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22731 use arbitrary::{Arbitrary, Unstructured};
22732 let mut buf = [0u8; 1024];
22733 rng.fill_bytes(&mut buf);
22734 let mut unstructured = Unstructured::new(&buf);
22735 Self::arbitrary(&mut unstructured).unwrap_or_default()
22736 }
22737}
22738impl Default for OPEN_DRONE_ID_MESSAGE_PACK_DATA {
22739 fn default() -> Self {
22740 Self::DEFAULT.clone()
22741 }
22742}
22743impl MessageData for OPEN_DRONE_ID_MESSAGE_PACK_DATA {
22744 type Message = MavMessage;
22745 const ID: u32 = 12915u32;
22746 const NAME: &'static str = "OPEN_DRONE_ID_MESSAGE_PACK";
22747 const EXTRA_CRC: u8 = 94u8;
22748 const ENCODED_LEN: usize = 249usize;
22749 fn deser(
22750 _version: MavlinkVersion,
22751 __input: &[u8],
22752 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22753 let avail_len = __input.len();
22754 let mut payload_buf = [0; Self::ENCODED_LEN];
22755 let mut buf = if avail_len < Self::ENCODED_LEN {
22756 payload_buf[0..avail_len].copy_from_slice(__input);
22757 Bytes::new(&payload_buf)
22758 } else {
22759 Bytes::new(__input)
22760 };
22761 let mut __struct = Self::default();
22762 __struct.target_system = buf.get_u8();
22763 __struct.target_component = buf.get_u8();
22764 for v in &mut __struct.id_or_mac {
22765 let val = buf.get_u8();
22766 *v = val;
22767 }
22768 __struct.single_message_size = buf.get_u8();
22769 __struct.msg_pack_size = buf.get_u8();
22770 for v in &mut __struct.messages {
22771 let val = buf.get_u8();
22772 *v = val;
22773 }
22774 Ok(__struct)
22775 }
22776 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22777 let mut __tmp = BytesMut::new(bytes);
22778 #[allow(clippy::absurd_extreme_comparisons)]
22779 #[allow(unused_comparisons)]
22780 if __tmp.remaining() < Self::ENCODED_LEN {
22781 panic!(
22782 "buffer is too small (need {} bytes, but got {})",
22783 Self::ENCODED_LEN,
22784 __tmp.remaining(),
22785 )
22786 }
22787 __tmp.put_u8(self.target_system);
22788 __tmp.put_u8(self.target_component);
22789 for val in &self.id_or_mac {
22790 __tmp.put_u8(*val);
22791 }
22792 __tmp.put_u8(self.single_message_size);
22793 __tmp.put_u8(self.msg_pack_size);
22794 for val in &self.messages {
22795 __tmp.put_u8(*val);
22796 }
22797 if matches!(version, MavlinkVersion::V2) {
22798 let len = __tmp.len();
22799 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22800 } else {
22801 __tmp.len()
22802 }
22803 }
22804}
22805#[doc = "Data for filling the OpenDroneID Operator ID message, which contains the CAA (Civil Aviation Authority) issued operator ID."]
22806#[doc = ""]
22807#[doc = "ID: 12905"]
22808#[derive(Debug, Clone, PartialEq)]
22809#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22810#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22811#[cfg_attr(feature = "ts", derive(TS))]
22812#[cfg_attr(feature = "ts", ts(export))]
22813pub struct OPEN_DRONE_ID_OPERATOR_ID_DATA {
22814 #[doc = "System ID (0 for broadcast)."]
22815 pub target_system: u8,
22816 #[doc = "Component ID (0 for broadcast)."]
22817 pub target_component: u8,
22818 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22819 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22820 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22821 pub id_or_mac: [u8; 20],
22822 #[doc = "Indicates the type of the operator_id field."]
22823 pub operator_id_type: MavOdidOperatorIdType,
22824 #[doc = "Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field."]
22825 #[cfg_attr(
22826 feature = "serde",
22827 serde(
22828 serialize_with = "crate::nulstr::serialize::<_, 20>",
22829 deserialize_with = "crate::nulstr::deserialize::<_, 20>"
22830 )
22831 )]
22832 #[cfg_attr(feature = "ts", ts(type = "string"))]
22833 pub operator_id: [u8; 20],
22834}
22835impl OPEN_DRONE_ID_OPERATOR_ID_DATA {
22836 pub const ENCODED_LEN: usize = 43usize;
22837 pub const DEFAULT: Self = Self {
22838 target_system: 0_u8,
22839 target_component: 0_u8,
22840 id_or_mac: [0_u8; 20usize],
22841 operator_id_type: MavOdidOperatorIdType::DEFAULT,
22842 operator_id: [0_u8; 20usize],
22843 };
22844 #[cfg(feature = "arbitrary")]
22845 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22846 use arbitrary::{Arbitrary, Unstructured};
22847 let mut buf = [0u8; 1024];
22848 rng.fill_bytes(&mut buf);
22849 let mut unstructured = Unstructured::new(&buf);
22850 Self::arbitrary(&mut unstructured).unwrap_or_default()
22851 }
22852}
22853impl Default for OPEN_DRONE_ID_OPERATOR_ID_DATA {
22854 fn default() -> Self {
22855 Self::DEFAULT.clone()
22856 }
22857}
22858impl MessageData for OPEN_DRONE_ID_OPERATOR_ID_DATA {
22859 type Message = MavMessage;
22860 const ID: u32 = 12905u32;
22861 const NAME: &'static str = "OPEN_DRONE_ID_OPERATOR_ID";
22862 const EXTRA_CRC: u8 = 49u8;
22863 const ENCODED_LEN: usize = 43usize;
22864 fn deser(
22865 _version: MavlinkVersion,
22866 __input: &[u8],
22867 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22868 let avail_len = __input.len();
22869 let mut payload_buf = [0; Self::ENCODED_LEN];
22870 let mut buf = if avail_len < Self::ENCODED_LEN {
22871 payload_buf[0..avail_len].copy_from_slice(__input);
22872 Bytes::new(&payload_buf)
22873 } else {
22874 Bytes::new(__input)
22875 };
22876 let mut __struct = Self::default();
22877 __struct.target_system = buf.get_u8();
22878 __struct.target_component = buf.get_u8();
22879 for v in &mut __struct.id_or_mac {
22880 let val = buf.get_u8();
22881 *v = val;
22882 }
22883 let tmp = buf.get_u8();
22884 __struct.operator_id_type =
22885 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22886 enum_type: "MavOdidOperatorIdType",
22887 value: tmp as u32,
22888 })?;
22889 for v in &mut __struct.operator_id {
22890 let val = buf.get_u8();
22891 *v = val;
22892 }
22893 Ok(__struct)
22894 }
22895 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22896 let mut __tmp = BytesMut::new(bytes);
22897 #[allow(clippy::absurd_extreme_comparisons)]
22898 #[allow(unused_comparisons)]
22899 if __tmp.remaining() < Self::ENCODED_LEN {
22900 panic!(
22901 "buffer is too small (need {} bytes, but got {})",
22902 Self::ENCODED_LEN,
22903 __tmp.remaining(),
22904 )
22905 }
22906 __tmp.put_u8(self.target_system);
22907 __tmp.put_u8(self.target_component);
22908 for val in &self.id_or_mac {
22909 __tmp.put_u8(*val);
22910 }
22911 __tmp.put_u8(self.operator_id_type as u8);
22912 for val in &self.operator_id {
22913 __tmp.put_u8(*val);
22914 }
22915 if matches!(version, MavlinkVersion::V2) {
22916 let len = __tmp.len();
22917 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22918 } else {
22919 __tmp.len()
22920 }
22921 }
22922}
22923#[doc = "Data for filling the OpenDroneID Self ID message. The Self ID Message is an opportunity for the operator to (optionally) declare their identity and purpose of the flight. This message can provide additional information that could reduce the threat profile of a UA (Unmanned Aircraft) flying in a particular area or manner. This message can also be used to provide optional additional clarification in an emergency/remote ID system failure situation."]
22924#[doc = ""]
22925#[doc = "ID: 12903"]
22926#[derive(Debug, Clone, PartialEq)]
22927#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22928#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22929#[cfg_attr(feature = "ts", derive(TS))]
22930#[cfg_attr(feature = "ts", ts(export))]
22931pub struct OPEN_DRONE_ID_SELF_ID_DATA {
22932 #[doc = "System ID (0 for broadcast)."]
22933 pub target_system: u8,
22934 #[doc = "Component ID (0 for broadcast)."]
22935 pub target_component: u8,
22936 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22937 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22938 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22939 pub id_or_mac: [u8; 20],
22940 #[doc = "Indicates the type of the description field."]
22941 pub description_type: MavOdidDescType,
22942 #[doc = "Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field."]
22943 #[cfg_attr(
22944 feature = "serde",
22945 serde(
22946 serialize_with = "crate::nulstr::serialize::<_, 23>",
22947 deserialize_with = "crate::nulstr::deserialize::<_, 23>"
22948 )
22949 )]
22950 #[cfg_attr(feature = "ts", ts(type = "string"))]
22951 pub description: [u8; 23],
22952}
22953impl OPEN_DRONE_ID_SELF_ID_DATA {
22954 pub const ENCODED_LEN: usize = 46usize;
22955 pub const DEFAULT: Self = Self {
22956 target_system: 0_u8,
22957 target_component: 0_u8,
22958 id_or_mac: [0_u8; 20usize],
22959 description_type: MavOdidDescType::DEFAULT,
22960 description: [0_u8; 23usize],
22961 };
22962 #[cfg(feature = "arbitrary")]
22963 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22964 use arbitrary::{Arbitrary, Unstructured};
22965 let mut buf = [0u8; 1024];
22966 rng.fill_bytes(&mut buf);
22967 let mut unstructured = Unstructured::new(&buf);
22968 Self::arbitrary(&mut unstructured).unwrap_or_default()
22969 }
22970}
22971impl Default for OPEN_DRONE_ID_SELF_ID_DATA {
22972 fn default() -> Self {
22973 Self::DEFAULT.clone()
22974 }
22975}
22976impl MessageData for OPEN_DRONE_ID_SELF_ID_DATA {
22977 type Message = MavMessage;
22978 const ID: u32 = 12903u32;
22979 const NAME: &'static str = "OPEN_DRONE_ID_SELF_ID";
22980 const EXTRA_CRC: u8 = 249u8;
22981 const ENCODED_LEN: usize = 46usize;
22982 fn deser(
22983 _version: MavlinkVersion,
22984 __input: &[u8],
22985 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22986 let avail_len = __input.len();
22987 let mut payload_buf = [0; Self::ENCODED_LEN];
22988 let mut buf = if avail_len < Self::ENCODED_LEN {
22989 payload_buf[0..avail_len].copy_from_slice(__input);
22990 Bytes::new(&payload_buf)
22991 } else {
22992 Bytes::new(__input)
22993 };
22994 let mut __struct = Self::default();
22995 __struct.target_system = buf.get_u8();
22996 __struct.target_component = buf.get_u8();
22997 for v in &mut __struct.id_or_mac {
22998 let val = buf.get_u8();
22999 *v = val;
23000 }
23001 let tmp = buf.get_u8();
23002 __struct.description_type =
23003 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23004 enum_type: "MavOdidDescType",
23005 value: tmp as u32,
23006 })?;
23007 for v in &mut __struct.description {
23008 let val = buf.get_u8();
23009 *v = val;
23010 }
23011 Ok(__struct)
23012 }
23013 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23014 let mut __tmp = BytesMut::new(bytes);
23015 #[allow(clippy::absurd_extreme_comparisons)]
23016 #[allow(unused_comparisons)]
23017 if __tmp.remaining() < Self::ENCODED_LEN {
23018 panic!(
23019 "buffer is too small (need {} bytes, but got {})",
23020 Self::ENCODED_LEN,
23021 __tmp.remaining(),
23022 )
23023 }
23024 __tmp.put_u8(self.target_system);
23025 __tmp.put_u8(self.target_component);
23026 for val in &self.id_or_mac {
23027 __tmp.put_u8(*val);
23028 }
23029 __tmp.put_u8(self.description_type as u8);
23030 for val in &self.description {
23031 __tmp.put_u8(*val);
23032 }
23033 if matches!(version, MavlinkVersion::V2) {
23034 let len = __tmp.len();
23035 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23036 } else {
23037 __tmp.len()
23038 }
23039 }
23040}
23041#[doc = "Data for filling the OpenDroneID System message. The System Message contains general system information including the operator location/altitude and possible aircraft group and/or category/class information."]
23042#[doc = ""]
23043#[doc = "ID: 12904"]
23044#[derive(Debug, Clone, PartialEq)]
23045#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23046#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23047#[cfg_attr(feature = "ts", derive(TS))]
23048#[cfg_attr(feature = "ts", ts(export))]
23049pub struct OPEN_DRONE_ID_SYSTEM_DATA {
23050 #[doc = "Latitude of the operator. If unknown: 0 (both Lat/Lon)."]
23051 pub operator_latitude: i32,
23052 #[doc = "Longitude of the operator. If unknown: 0 (both Lat/Lon)."]
23053 pub operator_longitude: i32,
23054 #[doc = "Area Operations Ceiling relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA."]
23055 pub area_ceiling: f32,
23056 #[doc = "Area Operations Floor relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA."]
23057 pub area_floor: f32,
23058 #[doc = "Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m."]
23059 pub operator_altitude_geo: f32,
23060 #[doc = "32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
23061 pub timestamp: u32,
23062 #[doc = "Number of aircraft in the area, group or formation (default 1). Used only for swarms/multiple UA."]
23063 pub area_count: u16,
23064 #[doc = "Radius of the cylindrical area of the group or formation (default 0). Used only for swarms/multiple UA."]
23065 pub area_radius: u16,
23066 #[doc = "System ID (0 for broadcast)."]
23067 pub target_system: u8,
23068 #[doc = "Component ID (0 for broadcast)."]
23069 pub target_component: u8,
23070 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
23071 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23072 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
23073 pub id_or_mac: [u8; 20],
23074 #[doc = "Specifies the operator location type."]
23075 pub operator_location_type: MavOdidOperatorLocationType,
23076 #[doc = "Specifies the classification type of the UA."]
23077 pub classification_type: MavOdidClassificationType,
23078 #[doc = "When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the category of the UA."]
23079 pub category_eu: MavOdidCategoryEu,
23080 #[doc = "When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the class of the UA."]
23081 pub class_eu: MavOdidClassEu,
23082}
23083impl OPEN_DRONE_ID_SYSTEM_DATA {
23084 pub const ENCODED_LEN: usize = 54usize;
23085 pub const DEFAULT: Self = Self {
23086 operator_latitude: 0_i32,
23087 operator_longitude: 0_i32,
23088 area_ceiling: 0.0_f32,
23089 area_floor: 0.0_f32,
23090 operator_altitude_geo: 0.0_f32,
23091 timestamp: 0_u32,
23092 area_count: 0_u16,
23093 area_radius: 0_u16,
23094 target_system: 0_u8,
23095 target_component: 0_u8,
23096 id_or_mac: [0_u8; 20usize],
23097 operator_location_type: MavOdidOperatorLocationType::DEFAULT,
23098 classification_type: MavOdidClassificationType::DEFAULT,
23099 category_eu: MavOdidCategoryEu::DEFAULT,
23100 class_eu: MavOdidClassEu::DEFAULT,
23101 };
23102 #[cfg(feature = "arbitrary")]
23103 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23104 use arbitrary::{Arbitrary, Unstructured};
23105 let mut buf = [0u8; 1024];
23106 rng.fill_bytes(&mut buf);
23107 let mut unstructured = Unstructured::new(&buf);
23108 Self::arbitrary(&mut unstructured).unwrap_or_default()
23109 }
23110}
23111impl Default for OPEN_DRONE_ID_SYSTEM_DATA {
23112 fn default() -> Self {
23113 Self::DEFAULT.clone()
23114 }
23115}
23116impl MessageData for OPEN_DRONE_ID_SYSTEM_DATA {
23117 type Message = MavMessage;
23118 const ID: u32 = 12904u32;
23119 const NAME: &'static str = "OPEN_DRONE_ID_SYSTEM";
23120 const EXTRA_CRC: u8 = 77u8;
23121 const ENCODED_LEN: usize = 54usize;
23122 fn deser(
23123 _version: MavlinkVersion,
23124 __input: &[u8],
23125 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23126 let avail_len = __input.len();
23127 let mut payload_buf = [0; Self::ENCODED_LEN];
23128 let mut buf = if avail_len < Self::ENCODED_LEN {
23129 payload_buf[0..avail_len].copy_from_slice(__input);
23130 Bytes::new(&payload_buf)
23131 } else {
23132 Bytes::new(__input)
23133 };
23134 let mut __struct = Self::default();
23135 __struct.operator_latitude = buf.get_i32_le();
23136 __struct.operator_longitude = buf.get_i32_le();
23137 __struct.area_ceiling = buf.get_f32_le();
23138 __struct.area_floor = buf.get_f32_le();
23139 __struct.operator_altitude_geo = buf.get_f32_le();
23140 __struct.timestamp = buf.get_u32_le();
23141 __struct.area_count = buf.get_u16_le();
23142 __struct.area_radius = buf.get_u16_le();
23143 __struct.target_system = buf.get_u8();
23144 __struct.target_component = buf.get_u8();
23145 for v in &mut __struct.id_or_mac {
23146 let val = buf.get_u8();
23147 *v = val;
23148 }
23149 let tmp = buf.get_u8();
23150 __struct.operator_location_type =
23151 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23152 enum_type: "MavOdidOperatorLocationType",
23153 value: tmp as u32,
23154 })?;
23155 let tmp = buf.get_u8();
23156 __struct.classification_type =
23157 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23158 enum_type: "MavOdidClassificationType",
23159 value: tmp as u32,
23160 })?;
23161 let tmp = buf.get_u8();
23162 __struct.category_eu =
23163 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23164 enum_type: "MavOdidCategoryEu",
23165 value: tmp as u32,
23166 })?;
23167 let tmp = buf.get_u8();
23168 __struct.class_eu =
23169 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23170 enum_type: "MavOdidClassEu",
23171 value: tmp as u32,
23172 })?;
23173 Ok(__struct)
23174 }
23175 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23176 let mut __tmp = BytesMut::new(bytes);
23177 #[allow(clippy::absurd_extreme_comparisons)]
23178 #[allow(unused_comparisons)]
23179 if __tmp.remaining() < Self::ENCODED_LEN {
23180 panic!(
23181 "buffer is too small (need {} bytes, but got {})",
23182 Self::ENCODED_LEN,
23183 __tmp.remaining(),
23184 )
23185 }
23186 __tmp.put_i32_le(self.operator_latitude);
23187 __tmp.put_i32_le(self.operator_longitude);
23188 __tmp.put_f32_le(self.area_ceiling);
23189 __tmp.put_f32_le(self.area_floor);
23190 __tmp.put_f32_le(self.operator_altitude_geo);
23191 __tmp.put_u32_le(self.timestamp);
23192 __tmp.put_u16_le(self.area_count);
23193 __tmp.put_u16_le(self.area_radius);
23194 __tmp.put_u8(self.target_system);
23195 __tmp.put_u8(self.target_component);
23196 for val in &self.id_or_mac {
23197 __tmp.put_u8(*val);
23198 }
23199 __tmp.put_u8(self.operator_location_type as u8);
23200 __tmp.put_u8(self.classification_type as u8);
23201 __tmp.put_u8(self.category_eu as u8);
23202 __tmp.put_u8(self.class_eu as u8);
23203 if matches!(version, MavlinkVersion::V2) {
23204 let len = __tmp.len();
23205 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23206 } else {
23207 __tmp.len()
23208 }
23209 }
23210}
23211#[doc = "Update the data in the OPEN_DRONE_ID_SYSTEM message with new location information. This can be sent to update the location information for the operator when no other information in the SYSTEM message has changed. This message allows for efficient operation on radio links which have limited uplink bandwidth while meeting requirements for update frequency of the operator location."]
23212#[doc = ""]
23213#[doc = "ID: 12919"]
23214#[derive(Debug, Clone, PartialEq)]
23215#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23216#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23217#[cfg_attr(feature = "ts", derive(TS))]
23218#[cfg_attr(feature = "ts", ts(export))]
23219pub struct OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
23220 #[doc = "Latitude of the operator. If unknown: 0 (both Lat/Lon)."]
23221 pub operator_latitude: i32,
23222 #[doc = "Longitude of the operator. If unknown: 0 (both Lat/Lon)."]
23223 pub operator_longitude: i32,
23224 #[doc = "Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m."]
23225 pub operator_altitude_geo: f32,
23226 #[doc = "32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
23227 pub timestamp: u32,
23228 #[doc = "System ID (0 for broadcast)."]
23229 pub target_system: u8,
23230 #[doc = "Component ID (0 for broadcast)."]
23231 pub target_component: u8,
23232}
23233impl OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
23234 pub const ENCODED_LEN: usize = 18usize;
23235 pub const DEFAULT: Self = Self {
23236 operator_latitude: 0_i32,
23237 operator_longitude: 0_i32,
23238 operator_altitude_geo: 0.0_f32,
23239 timestamp: 0_u32,
23240 target_system: 0_u8,
23241 target_component: 0_u8,
23242 };
23243 #[cfg(feature = "arbitrary")]
23244 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23245 use arbitrary::{Arbitrary, Unstructured};
23246 let mut buf = [0u8; 1024];
23247 rng.fill_bytes(&mut buf);
23248 let mut unstructured = Unstructured::new(&buf);
23249 Self::arbitrary(&mut unstructured).unwrap_or_default()
23250 }
23251}
23252impl Default for OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
23253 fn default() -> Self {
23254 Self::DEFAULT.clone()
23255 }
23256}
23257impl MessageData for OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
23258 type Message = MavMessage;
23259 const ID: u32 = 12919u32;
23260 const NAME: &'static str = "OPEN_DRONE_ID_SYSTEM_UPDATE";
23261 const EXTRA_CRC: u8 = 7u8;
23262 const ENCODED_LEN: usize = 18usize;
23263 fn deser(
23264 _version: MavlinkVersion,
23265 __input: &[u8],
23266 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23267 let avail_len = __input.len();
23268 let mut payload_buf = [0; Self::ENCODED_LEN];
23269 let mut buf = if avail_len < Self::ENCODED_LEN {
23270 payload_buf[0..avail_len].copy_from_slice(__input);
23271 Bytes::new(&payload_buf)
23272 } else {
23273 Bytes::new(__input)
23274 };
23275 let mut __struct = Self::default();
23276 __struct.operator_latitude = buf.get_i32_le();
23277 __struct.operator_longitude = buf.get_i32_le();
23278 __struct.operator_altitude_geo = buf.get_f32_le();
23279 __struct.timestamp = buf.get_u32_le();
23280 __struct.target_system = buf.get_u8();
23281 __struct.target_component = buf.get_u8();
23282 Ok(__struct)
23283 }
23284 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23285 let mut __tmp = BytesMut::new(bytes);
23286 #[allow(clippy::absurd_extreme_comparisons)]
23287 #[allow(unused_comparisons)]
23288 if __tmp.remaining() < Self::ENCODED_LEN {
23289 panic!(
23290 "buffer is too small (need {} bytes, but got {})",
23291 Self::ENCODED_LEN,
23292 __tmp.remaining(),
23293 )
23294 }
23295 __tmp.put_i32_le(self.operator_latitude);
23296 __tmp.put_i32_le(self.operator_longitude);
23297 __tmp.put_f32_le(self.operator_altitude_geo);
23298 __tmp.put_u32_le(self.timestamp);
23299 __tmp.put_u8(self.target_system);
23300 __tmp.put_u8(self.target_component);
23301 if matches!(version, MavlinkVersion::V2) {
23302 let len = __tmp.len();
23303 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23304 } else {
23305 __tmp.len()
23306 }
23307 }
23308}
23309#[doc = "Optical flow from a flow sensor (e.g. optical mouse sensor)."]
23310#[doc = ""]
23311#[doc = "ID: 100"]
23312#[derive(Debug, Clone, PartialEq)]
23313#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23314#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23315#[cfg_attr(feature = "ts", derive(TS))]
23316#[cfg_attr(feature = "ts", ts(export))]
23317pub struct OPTICAL_FLOW_DATA {
23318 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
23319 pub time_usec: u64,
23320 #[doc = "Flow in x-sensor direction, angular-speed compensated"]
23321 pub flow_comp_m_x: f32,
23322 #[doc = "Flow in y-sensor direction, angular-speed compensated"]
23323 pub flow_comp_m_y: f32,
23324 #[doc = "Ground distance. Positive value: distance known. Negative value: Unknown distance"]
23325 pub ground_distance: f32,
23326 #[doc = "Flow in x-sensor direction"]
23327 pub flow_x: i16,
23328 #[doc = "Flow in y-sensor direction"]
23329 pub flow_y: i16,
23330 #[doc = "Sensor ID"]
23331 pub sensor_id: u8,
23332 #[doc = "Optical flow quality / confidence. 0: bad, 255: maximum quality"]
23333 pub quality: u8,
23334 #[doc = "Flow rate about X axis"]
23335 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
23336 pub flow_rate_x: f32,
23337 #[doc = "Flow rate about Y axis"]
23338 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
23339 pub flow_rate_y: f32,
23340}
23341impl OPTICAL_FLOW_DATA {
23342 pub const ENCODED_LEN: usize = 34usize;
23343 pub const DEFAULT: Self = Self {
23344 time_usec: 0_u64,
23345 flow_comp_m_x: 0.0_f32,
23346 flow_comp_m_y: 0.0_f32,
23347 ground_distance: 0.0_f32,
23348 flow_x: 0_i16,
23349 flow_y: 0_i16,
23350 sensor_id: 0_u8,
23351 quality: 0_u8,
23352 flow_rate_x: 0.0_f32,
23353 flow_rate_y: 0.0_f32,
23354 };
23355 #[cfg(feature = "arbitrary")]
23356 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23357 use arbitrary::{Arbitrary, Unstructured};
23358 let mut buf = [0u8; 1024];
23359 rng.fill_bytes(&mut buf);
23360 let mut unstructured = Unstructured::new(&buf);
23361 Self::arbitrary(&mut unstructured).unwrap_or_default()
23362 }
23363}
23364impl Default for OPTICAL_FLOW_DATA {
23365 fn default() -> Self {
23366 Self::DEFAULT.clone()
23367 }
23368}
23369impl MessageData for OPTICAL_FLOW_DATA {
23370 type Message = MavMessage;
23371 const ID: u32 = 100u32;
23372 const NAME: &'static str = "OPTICAL_FLOW";
23373 const EXTRA_CRC: u8 = 175u8;
23374 const ENCODED_LEN: usize = 34usize;
23375 fn deser(
23376 _version: MavlinkVersion,
23377 __input: &[u8],
23378 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23379 let avail_len = __input.len();
23380 let mut payload_buf = [0; Self::ENCODED_LEN];
23381 let mut buf = if avail_len < Self::ENCODED_LEN {
23382 payload_buf[0..avail_len].copy_from_slice(__input);
23383 Bytes::new(&payload_buf)
23384 } else {
23385 Bytes::new(__input)
23386 };
23387 let mut __struct = Self::default();
23388 __struct.time_usec = buf.get_u64_le();
23389 __struct.flow_comp_m_x = buf.get_f32_le();
23390 __struct.flow_comp_m_y = buf.get_f32_le();
23391 __struct.ground_distance = buf.get_f32_le();
23392 __struct.flow_x = buf.get_i16_le();
23393 __struct.flow_y = buf.get_i16_le();
23394 __struct.sensor_id = buf.get_u8();
23395 __struct.quality = buf.get_u8();
23396 __struct.flow_rate_x = buf.get_f32_le();
23397 __struct.flow_rate_y = buf.get_f32_le();
23398 Ok(__struct)
23399 }
23400 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23401 let mut __tmp = BytesMut::new(bytes);
23402 #[allow(clippy::absurd_extreme_comparisons)]
23403 #[allow(unused_comparisons)]
23404 if __tmp.remaining() < Self::ENCODED_LEN {
23405 panic!(
23406 "buffer is too small (need {} bytes, but got {})",
23407 Self::ENCODED_LEN,
23408 __tmp.remaining(),
23409 )
23410 }
23411 __tmp.put_u64_le(self.time_usec);
23412 __tmp.put_f32_le(self.flow_comp_m_x);
23413 __tmp.put_f32_le(self.flow_comp_m_y);
23414 __tmp.put_f32_le(self.ground_distance);
23415 __tmp.put_i16_le(self.flow_x);
23416 __tmp.put_i16_le(self.flow_y);
23417 __tmp.put_u8(self.sensor_id);
23418 __tmp.put_u8(self.quality);
23419 if matches!(version, MavlinkVersion::V2) {
23420 __tmp.put_f32_le(self.flow_rate_x);
23421 __tmp.put_f32_le(self.flow_rate_y);
23422 let len = __tmp.len();
23423 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23424 } else {
23425 __tmp.len()
23426 }
23427 }
23428}
23429#[doc = "Optical flow from an angular rate flow sensor (e.g. PX4FLOW or mouse sensor)."]
23430#[doc = ""]
23431#[doc = "ID: 106"]
23432#[derive(Debug, Clone, PartialEq)]
23433#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23434#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23435#[cfg_attr(feature = "ts", derive(TS))]
23436#[cfg_attr(feature = "ts", ts(export))]
23437pub struct OPTICAL_FLOW_RAD_DATA {
23438 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
23439 pub time_usec: u64,
23440 #[doc = "Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the."]
23441 pub integration_time_us: u32,
23442 #[doc = "Flow around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)"]
23443 pub integrated_x: f32,
23444 #[doc = "Flow around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)"]
23445 pub integrated_y: f32,
23446 #[doc = "RH rotation around X axis"]
23447 pub integrated_xgyro: f32,
23448 #[doc = "RH rotation around Y axis"]
23449 pub integrated_ygyro: f32,
23450 #[doc = "RH rotation around Z axis"]
23451 pub integrated_zgyro: f32,
23452 #[doc = "Time since the distance was sampled."]
23453 pub time_delta_distance_us: u32,
23454 #[doc = "Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance."]
23455 pub distance: f32,
23456 #[doc = "Temperature"]
23457 pub temperature: i16,
23458 #[doc = "Sensor ID"]
23459 pub sensor_id: u8,
23460 #[doc = "Optical flow quality / confidence. 0: no valid flow, 255: maximum quality"]
23461 pub quality: u8,
23462}
23463impl OPTICAL_FLOW_RAD_DATA {
23464 pub const ENCODED_LEN: usize = 44usize;
23465 pub const DEFAULT: Self = Self {
23466 time_usec: 0_u64,
23467 integration_time_us: 0_u32,
23468 integrated_x: 0.0_f32,
23469 integrated_y: 0.0_f32,
23470 integrated_xgyro: 0.0_f32,
23471 integrated_ygyro: 0.0_f32,
23472 integrated_zgyro: 0.0_f32,
23473 time_delta_distance_us: 0_u32,
23474 distance: 0.0_f32,
23475 temperature: 0_i16,
23476 sensor_id: 0_u8,
23477 quality: 0_u8,
23478 };
23479 #[cfg(feature = "arbitrary")]
23480 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23481 use arbitrary::{Arbitrary, Unstructured};
23482 let mut buf = [0u8; 1024];
23483 rng.fill_bytes(&mut buf);
23484 let mut unstructured = Unstructured::new(&buf);
23485 Self::arbitrary(&mut unstructured).unwrap_or_default()
23486 }
23487}
23488impl Default for OPTICAL_FLOW_RAD_DATA {
23489 fn default() -> Self {
23490 Self::DEFAULT.clone()
23491 }
23492}
23493impl MessageData for OPTICAL_FLOW_RAD_DATA {
23494 type Message = MavMessage;
23495 const ID: u32 = 106u32;
23496 const NAME: &'static str = "OPTICAL_FLOW_RAD";
23497 const EXTRA_CRC: u8 = 138u8;
23498 const ENCODED_LEN: usize = 44usize;
23499 fn deser(
23500 _version: MavlinkVersion,
23501 __input: &[u8],
23502 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23503 let avail_len = __input.len();
23504 let mut payload_buf = [0; Self::ENCODED_LEN];
23505 let mut buf = if avail_len < Self::ENCODED_LEN {
23506 payload_buf[0..avail_len].copy_from_slice(__input);
23507 Bytes::new(&payload_buf)
23508 } else {
23509 Bytes::new(__input)
23510 };
23511 let mut __struct = Self::default();
23512 __struct.time_usec = buf.get_u64_le();
23513 __struct.integration_time_us = buf.get_u32_le();
23514 __struct.integrated_x = buf.get_f32_le();
23515 __struct.integrated_y = buf.get_f32_le();
23516 __struct.integrated_xgyro = buf.get_f32_le();
23517 __struct.integrated_ygyro = buf.get_f32_le();
23518 __struct.integrated_zgyro = buf.get_f32_le();
23519 __struct.time_delta_distance_us = buf.get_u32_le();
23520 __struct.distance = buf.get_f32_le();
23521 __struct.temperature = buf.get_i16_le();
23522 __struct.sensor_id = buf.get_u8();
23523 __struct.quality = buf.get_u8();
23524 Ok(__struct)
23525 }
23526 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23527 let mut __tmp = BytesMut::new(bytes);
23528 #[allow(clippy::absurd_extreme_comparisons)]
23529 #[allow(unused_comparisons)]
23530 if __tmp.remaining() < Self::ENCODED_LEN {
23531 panic!(
23532 "buffer is too small (need {} bytes, but got {})",
23533 Self::ENCODED_LEN,
23534 __tmp.remaining(),
23535 )
23536 }
23537 __tmp.put_u64_le(self.time_usec);
23538 __tmp.put_u32_le(self.integration_time_us);
23539 __tmp.put_f32_le(self.integrated_x);
23540 __tmp.put_f32_le(self.integrated_y);
23541 __tmp.put_f32_le(self.integrated_xgyro);
23542 __tmp.put_f32_le(self.integrated_ygyro);
23543 __tmp.put_f32_le(self.integrated_zgyro);
23544 __tmp.put_u32_le(self.time_delta_distance_us);
23545 __tmp.put_f32_le(self.distance);
23546 __tmp.put_i16_le(self.temperature);
23547 __tmp.put_u8(self.sensor_id);
23548 __tmp.put_u8(self.quality);
23549 if matches!(version, MavlinkVersion::V2) {
23550 let len = __tmp.len();
23551 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23552 } else {
23553 __tmp.len()
23554 }
23555 }
23556}
23557#[doc = "Vehicle status report that is sent out while orbit execution is in progress (see MAV_CMD_DO_ORBIT)."]
23558#[doc = ""]
23559#[doc = "ID: 360"]
23560#[derive(Debug, Clone, PartialEq)]
23561#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23562#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23563#[cfg_attr(feature = "ts", derive(TS))]
23564#[cfg_attr(feature = "ts", ts(export))]
23565pub struct ORBIT_EXECUTION_STATUS_DATA {
23566 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
23567 pub time_usec: u64,
23568 #[doc = "Radius of the orbit circle. Positive values orbit clockwise, negative values orbit counter-clockwise."]
23569 pub radius: f32,
23570 #[doc = "X coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7."]
23571 pub x: i32,
23572 #[doc = "Y coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7."]
23573 pub y: i32,
23574 #[doc = "Altitude of center point. Coordinate system depends on frame field."]
23575 pub z: f32,
23576 #[doc = "The coordinate system of the fields: x, y, z."]
23577 pub frame: MavFrame,
23578}
23579impl ORBIT_EXECUTION_STATUS_DATA {
23580 pub const ENCODED_LEN: usize = 25usize;
23581 pub const DEFAULT: Self = Self {
23582 time_usec: 0_u64,
23583 radius: 0.0_f32,
23584 x: 0_i32,
23585 y: 0_i32,
23586 z: 0.0_f32,
23587 frame: MavFrame::DEFAULT,
23588 };
23589 #[cfg(feature = "arbitrary")]
23590 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23591 use arbitrary::{Arbitrary, Unstructured};
23592 let mut buf = [0u8; 1024];
23593 rng.fill_bytes(&mut buf);
23594 let mut unstructured = Unstructured::new(&buf);
23595 Self::arbitrary(&mut unstructured).unwrap_or_default()
23596 }
23597}
23598impl Default for ORBIT_EXECUTION_STATUS_DATA {
23599 fn default() -> Self {
23600 Self::DEFAULT.clone()
23601 }
23602}
23603impl MessageData for ORBIT_EXECUTION_STATUS_DATA {
23604 type Message = MavMessage;
23605 const ID: u32 = 360u32;
23606 const NAME: &'static str = "ORBIT_EXECUTION_STATUS";
23607 const EXTRA_CRC: u8 = 11u8;
23608 const ENCODED_LEN: usize = 25usize;
23609 fn deser(
23610 _version: MavlinkVersion,
23611 __input: &[u8],
23612 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23613 let avail_len = __input.len();
23614 let mut payload_buf = [0; Self::ENCODED_LEN];
23615 let mut buf = if avail_len < Self::ENCODED_LEN {
23616 payload_buf[0..avail_len].copy_from_slice(__input);
23617 Bytes::new(&payload_buf)
23618 } else {
23619 Bytes::new(__input)
23620 };
23621 let mut __struct = Self::default();
23622 __struct.time_usec = buf.get_u64_le();
23623 __struct.radius = buf.get_f32_le();
23624 __struct.x = buf.get_i32_le();
23625 __struct.y = buf.get_i32_le();
23626 __struct.z = buf.get_f32_le();
23627 let tmp = buf.get_u8();
23628 __struct.frame =
23629 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23630 enum_type: "MavFrame",
23631 value: tmp as u32,
23632 })?;
23633 Ok(__struct)
23634 }
23635 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23636 let mut __tmp = BytesMut::new(bytes);
23637 #[allow(clippy::absurd_extreme_comparisons)]
23638 #[allow(unused_comparisons)]
23639 if __tmp.remaining() < Self::ENCODED_LEN {
23640 panic!(
23641 "buffer is too small (need {} bytes, but got {})",
23642 Self::ENCODED_LEN,
23643 __tmp.remaining(),
23644 )
23645 }
23646 __tmp.put_u64_le(self.time_usec);
23647 __tmp.put_f32_le(self.radius);
23648 __tmp.put_i32_le(self.x);
23649 __tmp.put_i32_le(self.y);
23650 __tmp.put_f32_le(self.z);
23651 __tmp.put_u8(self.frame as u8);
23652 if matches!(version, MavlinkVersion::V2) {
23653 let len = __tmp.len();
23654 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23655 } else {
23656 __tmp.len()
23657 }
23658 }
23659}
23660#[doc = "Response from a PARAM_EXT_SET message."]
23661#[doc = ""]
23662#[doc = "ID: 324"]
23663#[derive(Debug, Clone, PartialEq)]
23664#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23665#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23666#[cfg_attr(feature = "ts", derive(TS))]
23667#[cfg_attr(feature = "ts", ts(export))]
23668pub struct PARAM_EXT_ACK_DATA {
23669 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23670 #[cfg_attr(
23671 feature = "serde",
23672 serde(
23673 serialize_with = "crate::nulstr::serialize::<_, 16>",
23674 deserialize_with = "crate::nulstr::deserialize::<_, 16>"
23675 )
23676 )]
23677 #[cfg_attr(feature = "ts", ts(type = "string"))]
23678 pub param_id: [u8; 16],
23679 #[doc = "Parameter value (new value if PARAM_ACK_ACCEPTED, current value otherwise)"]
23680 #[cfg_attr(
23681 feature = "serde",
23682 serde(
23683 serialize_with = "crate::nulstr::serialize::<_, 128>",
23684 deserialize_with = "crate::nulstr::deserialize::<_, 128>"
23685 )
23686 )]
23687 #[cfg_attr(feature = "ts", ts(type = "string"))]
23688 pub param_value: [u8; 128],
23689 #[doc = "Parameter type."]
23690 pub param_type: MavParamExtType,
23691 #[doc = "Result code."]
23692 pub param_result: ParamAck,
23693}
23694impl PARAM_EXT_ACK_DATA {
23695 pub const ENCODED_LEN: usize = 146usize;
23696 pub const DEFAULT: Self = Self {
23697 param_id: [0_u8; 16usize],
23698 param_value: [0_u8; 128usize],
23699 param_type: MavParamExtType::DEFAULT,
23700 param_result: ParamAck::DEFAULT,
23701 };
23702 #[cfg(feature = "arbitrary")]
23703 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23704 use arbitrary::{Arbitrary, Unstructured};
23705 let mut buf = [0u8; 1024];
23706 rng.fill_bytes(&mut buf);
23707 let mut unstructured = Unstructured::new(&buf);
23708 Self::arbitrary(&mut unstructured).unwrap_or_default()
23709 }
23710}
23711impl Default for PARAM_EXT_ACK_DATA {
23712 fn default() -> Self {
23713 Self::DEFAULT.clone()
23714 }
23715}
23716impl MessageData for PARAM_EXT_ACK_DATA {
23717 type Message = MavMessage;
23718 const ID: u32 = 324u32;
23719 const NAME: &'static str = "PARAM_EXT_ACK";
23720 const EXTRA_CRC: u8 = 132u8;
23721 const ENCODED_LEN: usize = 146usize;
23722 fn deser(
23723 _version: MavlinkVersion,
23724 __input: &[u8],
23725 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23726 let avail_len = __input.len();
23727 let mut payload_buf = [0; Self::ENCODED_LEN];
23728 let mut buf = if avail_len < Self::ENCODED_LEN {
23729 payload_buf[0..avail_len].copy_from_slice(__input);
23730 Bytes::new(&payload_buf)
23731 } else {
23732 Bytes::new(__input)
23733 };
23734 let mut __struct = Self::default();
23735 for v in &mut __struct.param_id {
23736 let val = buf.get_u8();
23737 *v = val;
23738 }
23739 for v in &mut __struct.param_value {
23740 let val = buf.get_u8();
23741 *v = val;
23742 }
23743 let tmp = buf.get_u8();
23744 __struct.param_type =
23745 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23746 enum_type: "MavParamExtType",
23747 value: tmp as u32,
23748 })?;
23749 let tmp = buf.get_u8();
23750 __struct.param_result =
23751 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23752 enum_type: "ParamAck",
23753 value: tmp as u32,
23754 })?;
23755 Ok(__struct)
23756 }
23757 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23758 let mut __tmp = BytesMut::new(bytes);
23759 #[allow(clippy::absurd_extreme_comparisons)]
23760 #[allow(unused_comparisons)]
23761 if __tmp.remaining() < Self::ENCODED_LEN {
23762 panic!(
23763 "buffer is too small (need {} bytes, but got {})",
23764 Self::ENCODED_LEN,
23765 __tmp.remaining(),
23766 )
23767 }
23768 for val in &self.param_id {
23769 __tmp.put_u8(*val);
23770 }
23771 for val in &self.param_value {
23772 __tmp.put_u8(*val);
23773 }
23774 __tmp.put_u8(self.param_type as u8);
23775 __tmp.put_u8(self.param_result as u8);
23776 if matches!(version, MavlinkVersion::V2) {
23777 let len = __tmp.len();
23778 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23779 } else {
23780 __tmp.len()
23781 }
23782 }
23783}
23784#[doc = "Request all parameters of this component. All parameters should be emitted in response as PARAM_EXT_VALUE."]
23785#[doc = ""]
23786#[doc = "ID: 321"]
23787#[derive(Debug, Clone, PartialEq)]
23788#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23789#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23790#[cfg_attr(feature = "ts", derive(TS))]
23791#[cfg_attr(feature = "ts", ts(export))]
23792pub struct PARAM_EXT_REQUEST_LIST_DATA {
23793 #[doc = "System ID"]
23794 pub target_system: u8,
23795 #[doc = "Component ID"]
23796 pub target_component: u8,
23797}
23798impl PARAM_EXT_REQUEST_LIST_DATA {
23799 pub const ENCODED_LEN: usize = 2usize;
23800 pub const DEFAULT: Self = Self {
23801 target_system: 0_u8,
23802 target_component: 0_u8,
23803 };
23804 #[cfg(feature = "arbitrary")]
23805 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23806 use arbitrary::{Arbitrary, Unstructured};
23807 let mut buf = [0u8; 1024];
23808 rng.fill_bytes(&mut buf);
23809 let mut unstructured = Unstructured::new(&buf);
23810 Self::arbitrary(&mut unstructured).unwrap_or_default()
23811 }
23812}
23813impl Default for PARAM_EXT_REQUEST_LIST_DATA {
23814 fn default() -> Self {
23815 Self::DEFAULT.clone()
23816 }
23817}
23818impl MessageData for PARAM_EXT_REQUEST_LIST_DATA {
23819 type Message = MavMessage;
23820 const ID: u32 = 321u32;
23821 const NAME: &'static str = "PARAM_EXT_REQUEST_LIST";
23822 const EXTRA_CRC: u8 = 88u8;
23823 const ENCODED_LEN: usize = 2usize;
23824 fn deser(
23825 _version: MavlinkVersion,
23826 __input: &[u8],
23827 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23828 let avail_len = __input.len();
23829 let mut payload_buf = [0; Self::ENCODED_LEN];
23830 let mut buf = if avail_len < Self::ENCODED_LEN {
23831 payload_buf[0..avail_len].copy_from_slice(__input);
23832 Bytes::new(&payload_buf)
23833 } else {
23834 Bytes::new(__input)
23835 };
23836 let mut __struct = Self::default();
23837 __struct.target_system = buf.get_u8();
23838 __struct.target_component = buf.get_u8();
23839 Ok(__struct)
23840 }
23841 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23842 let mut __tmp = BytesMut::new(bytes);
23843 #[allow(clippy::absurd_extreme_comparisons)]
23844 #[allow(unused_comparisons)]
23845 if __tmp.remaining() < Self::ENCODED_LEN {
23846 panic!(
23847 "buffer is too small (need {} bytes, but got {})",
23848 Self::ENCODED_LEN,
23849 __tmp.remaining(),
23850 )
23851 }
23852 __tmp.put_u8(self.target_system);
23853 __tmp.put_u8(self.target_component);
23854 if matches!(version, MavlinkVersion::V2) {
23855 let len = __tmp.len();
23856 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23857 } else {
23858 __tmp.len()
23859 }
23860 }
23861}
23862#[doc = "Request to read the value of a parameter with either the param_id string id or param_index. PARAM_EXT_VALUE should be emitted in response."]
23863#[doc = ""]
23864#[doc = "ID: 320"]
23865#[derive(Debug, Clone, PartialEq)]
23866#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23867#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23868#[cfg_attr(feature = "ts", derive(TS))]
23869#[cfg_attr(feature = "ts", ts(export))]
23870pub struct PARAM_EXT_REQUEST_READ_DATA {
23871 #[doc = "Parameter index. Set to -1 to use the Parameter ID field as identifier (else param_id will be ignored)"]
23872 pub param_index: i16,
23873 #[doc = "System ID"]
23874 pub target_system: u8,
23875 #[doc = "Component ID"]
23876 pub target_component: u8,
23877 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23878 #[cfg_attr(
23879 feature = "serde",
23880 serde(
23881 serialize_with = "crate::nulstr::serialize::<_, 16>",
23882 deserialize_with = "crate::nulstr::deserialize::<_, 16>"
23883 )
23884 )]
23885 #[cfg_attr(feature = "ts", ts(type = "string"))]
23886 pub param_id: [u8; 16],
23887}
23888impl PARAM_EXT_REQUEST_READ_DATA {
23889 pub const ENCODED_LEN: usize = 20usize;
23890 pub const DEFAULT: Self = Self {
23891 param_index: 0_i16,
23892 target_system: 0_u8,
23893 target_component: 0_u8,
23894 param_id: [0_u8; 16usize],
23895 };
23896 #[cfg(feature = "arbitrary")]
23897 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23898 use arbitrary::{Arbitrary, Unstructured};
23899 let mut buf = [0u8; 1024];
23900 rng.fill_bytes(&mut buf);
23901 let mut unstructured = Unstructured::new(&buf);
23902 Self::arbitrary(&mut unstructured).unwrap_or_default()
23903 }
23904}
23905impl Default for PARAM_EXT_REQUEST_READ_DATA {
23906 fn default() -> Self {
23907 Self::DEFAULT.clone()
23908 }
23909}
23910impl MessageData for PARAM_EXT_REQUEST_READ_DATA {
23911 type Message = MavMessage;
23912 const ID: u32 = 320u32;
23913 const NAME: &'static str = "PARAM_EXT_REQUEST_READ";
23914 const EXTRA_CRC: u8 = 243u8;
23915 const ENCODED_LEN: usize = 20usize;
23916 fn deser(
23917 _version: MavlinkVersion,
23918 __input: &[u8],
23919 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23920 let avail_len = __input.len();
23921 let mut payload_buf = [0; Self::ENCODED_LEN];
23922 let mut buf = if avail_len < Self::ENCODED_LEN {
23923 payload_buf[0..avail_len].copy_from_slice(__input);
23924 Bytes::new(&payload_buf)
23925 } else {
23926 Bytes::new(__input)
23927 };
23928 let mut __struct = Self::default();
23929 __struct.param_index = buf.get_i16_le();
23930 __struct.target_system = buf.get_u8();
23931 __struct.target_component = buf.get_u8();
23932 for v in &mut __struct.param_id {
23933 let val = buf.get_u8();
23934 *v = val;
23935 }
23936 Ok(__struct)
23937 }
23938 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23939 let mut __tmp = BytesMut::new(bytes);
23940 #[allow(clippy::absurd_extreme_comparisons)]
23941 #[allow(unused_comparisons)]
23942 if __tmp.remaining() < Self::ENCODED_LEN {
23943 panic!(
23944 "buffer is too small (need {} bytes, but got {})",
23945 Self::ENCODED_LEN,
23946 __tmp.remaining(),
23947 )
23948 }
23949 __tmp.put_i16_le(self.param_index);
23950 __tmp.put_u8(self.target_system);
23951 __tmp.put_u8(self.target_component);
23952 for val in &self.param_id {
23953 __tmp.put_u8(*val);
23954 }
23955 if matches!(version, MavlinkVersion::V2) {
23956 let len = __tmp.len();
23957 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23958 } else {
23959 __tmp.len()
23960 }
23961 }
23962}
23963#[doc = "Set a parameter value. In order to deal with message loss (and retransmission of PARAM_EXT_SET), when setting a parameter value and the new value is the same as the current value, you will immediately get a PARAM_ACK_ACCEPTED response. If the current state is PARAM_ACK_IN_PROGRESS, you will accordingly receive a PARAM_ACK_IN_PROGRESS in response."]
23964#[doc = ""]
23965#[doc = "ID: 323"]
23966#[derive(Debug, Clone, PartialEq)]
23967#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23968#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23969#[cfg_attr(feature = "ts", derive(TS))]
23970#[cfg_attr(feature = "ts", ts(export))]
23971pub struct PARAM_EXT_SET_DATA {
23972 #[doc = "System ID"]
23973 pub target_system: u8,
23974 #[doc = "Component ID"]
23975 pub target_component: u8,
23976 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23977 #[cfg_attr(
23978 feature = "serde",
23979 serde(
23980 serialize_with = "crate::nulstr::serialize::<_, 16>",
23981 deserialize_with = "crate::nulstr::deserialize::<_, 16>"
23982 )
23983 )]
23984 #[cfg_attr(feature = "ts", ts(type = "string"))]
23985 pub param_id: [u8; 16],
23986 #[doc = "Parameter value"]
23987 #[cfg_attr(
23988 feature = "serde",
23989 serde(
23990 serialize_with = "crate::nulstr::serialize::<_, 128>",
23991 deserialize_with = "crate::nulstr::deserialize::<_, 128>"
23992 )
23993 )]
23994 #[cfg_attr(feature = "ts", ts(type = "string"))]
23995 pub param_value: [u8; 128],
23996 #[doc = "Parameter type."]
23997 pub param_type: MavParamExtType,
23998}
23999impl PARAM_EXT_SET_DATA {
24000 pub const ENCODED_LEN: usize = 147usize;
24001 pub const DEFAULT: Self = Self {
24002 target_system: 0_u8,
24003 target_component: 0_u8,
24004 param_id: [0_u8; 16usize],
24005 param_value: [0_u8; 128usize],
24006 param_type: MavParamExtType::DEFAULT,
24007 };
24008 #[cfg(feature = "arbitrary")]
24009 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24010 use arbitrary::{Arbitrary, Unstructured};
24011 let mut buf = [0u8; 1024];
24012 rng.fill_bytes(&mut buf);
24013 let mut unstructured = Unstructured::new(&buf);
24014 Self::arbitrary(&mut unstructured).unwrap_or_default()
24015 }
24016}
24017impl Default for PARAM_EXT_SET_DATA {
24018 fn default() -> Self {
24019 Self::DEFAULT.clone()
24020 }
24021}
24022impl MessageData for PARAM_EXT_SET_DATA {
24023 type Message = MavMessage;
24024 const ID: u32 = 323u32;
24025 const NAME: &'static str = "PARAM_EXT_SET";
24026 const EXTRA_CRC: u8 = 78u8;
24027 const ENCODED_LEN: usize = 147usize;
24028 fn deser(
24029 _version: MavlinkVersion,
24030 __input: &[u8],
24031 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24032 let avail_len = __input.len();
24033 let mut payload_buf = [0; Self::ENCODED_LEN];
24034 let mut buf = if avail_len < Self::ENCODED_LEN {
24035 payload_buf[0..avail_len].copy_from_slice(__input);
24036 Bytes::new(&payload_buf)
24037 } else {
24038 Bytes::new(__input)
24039 };
24040 let mut __struct = Self::default();
24041 __struct.target_system = buf.get_u8();
24042 __struct.target_component = buf.get_u8();
24043 for v in &mut __struct.param_id {
24044 let val = buf.get_u8();
24045 *v = val;
24046 }
24047 for v in &mut __struct.param_value {
24048 let val = buf.get_u8();
24049 *v = val;
24050 }
24051 let tmp = buf.get_u8();
24052 __struct.param_type =
24053 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24054 enum_type: "MavParamExtType",
24055 value: tmp as u32,
24056 })?;
24057 Ok(__struct)
24058 }
24059 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24060 let mut __tmp = BytesMut::new(bytes);
24061 #[allow(clippy::absurd_extreme_comparisons)]
24062 #[allow(unused_comparisons)]
24063 if __tmp.remaining() < Self::ENCODED_LEN {
24064 panic!(
24065 "buffer is too small (need {} bytes, but got {})",
24066 Self::ENCODED_LEN,
24067 __tmp.remaining(),
24068 )
24069 }
24070 __tmp.put_u8(self.target_system);
24071 __tmp.put_u8(self.target_component);
24072 for val in &self.param_id {
24073 __tmp.put_u8(*val);
24074 }
24075 for val in &self.param_value {
24076 __tmp.put_u8(*val);
24077 }
24078 __tmp.put_u8(self.param_type as u8);
24079 if matches!(version, MavlinkVersion::V2) {
24080 let len = __tmp.len();
24081 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24082 } else {
24083 __tmp.len()
24084 }
24085 }
24086}
24087#[doc = "Emit the value of a parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows them to re-request missing parameters after a loss or timeout."]
24088#[doc = ""]
24089#[doc = "ID: 322"]
24090#[derive(Debug, Clone, PartialEq)]
24091#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24092#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24093#[cfg_attr(feature = "ts", derive(TS))]
24094#[cfg_attr(feature = "ts", ts(export))]
24095pub struct PARAM_EXT_VALUE_DATA {
24096 #[doc = "Total number of parameters"]
24097 pub param_count: u16,
24098 #[doc = "Index of this parameter"]
24099 pub param_index: u16,
24100 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
24101 #[cfg_attr(
24102 feature = "serde",
24103 serde(
24104 serialize_with = "crate::nulstr::serialize::<_, 16>",
24105 deserialize_with = "crate::nulstr::deserialize::<_, 16>"
24106 )
24107 )]
24108 #[cfg_attr(feature = "ts", ts(type = "string"))]
24109 pub param_id: [u8; 16],
24110 #[doc = "Parameter value"]
24111 #[cfg_attr(
24112 feature = "serde",
24113 serde(
24114 serialize_with = "crate::nulstr::serialize::<_, 128>",
24115 deserialize_with = "crate::nulstr::deserialize::<_, 128>"
24116 )
24117 )]
24118 #[cfg_attr(feature = "ts", ts(type = "string"))]
24119 pub param_value: [u8; 128],
24120 #[doc = "Parameter type."]
24121 pub param_type: MavParamExtType,
24122}
24123impl PARAM_EXT_VALUE_DATA {
24124 pub const ENCODED_LEN: usize = 149usize;
24125 pub const DEFAULT: Self = Self {
24126 param_count: 0_u16,
24127 param_index: 0_u16,
24128 param_id: [0_u8; 16usize],
24129 param_value: [0_u8; 128usize],
24130 param_type: MavParamExtType::DEFAULT,
24131 };
24132 #[cfg(feature = "arbitrary")]
24133 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24134 use arbitrary::{Arbitrary, Unstructured};
24135 let mut buf = [0u8; 1024];
24136 rng.fill_bytes(&mut buf);
24137 let mut unstructured = Unstructured::new(&buf);
24138 Self::arbitrary(&mut unstructured).unwrap_or_default()
24139 }
24140}
24141impl Default for PARAM_EXT_VALUE_DATA {
24142 fn default() -> Self {
24143 Self::DEFAULT.clone()
24144 }
24145}
24146impl MessageData for PARAM_EXT_VALUE_DATA {
24147 type Message = MavMessage;
24148 const ID: u32 = 322u32;
24149 const NAME: &'static str = "PARAM_EXT_VALUE";
24150 const EXTRA_CRC: u8 = 243u8;
24151 const ENCODED_LEN: usize = 149usize;
24152 fn deser(
24153 _version: MavlinkVersion,
24154 __input: &[u8],
24155 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24156 let avail_len = __input.len();
24157 let mut payload_buf = [0; Self::ENCODED_LEN];
24158 let mut buf = if avail_len < Self::ENCODED_LEN {
24159 payload_buf[0..avail_len].copy_from_slice(__input);
24160 Bytes::new(&payload_buf)
24161 } else {
24162 Bytes::new(__input)
24163 };
24164 let mut __struct = Self::default();
24165 __struct.param_count = buf.get_u16_le();
24166 __struct.param_index = buf.get_u16_le();
24167 for v in &mut __struct.param_id {
24168 let val = buf.get_u8();
24169 *v = val;
24170 }
24171 for v in &mut __struct.param_value {
24172 let val = buf.get_u8();
24173 *v = val;
24174 }
24175 let tmp = buf.get_u8();
24176 __struct.param_type =
24177 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24178 enum_type: "MavParamExtType",
24179 value: tmp as u32,
24180 })?;
24181 Ok(__struct)
24182 }
24183 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24184 let mut __tmp = BytesMut::new(bytes);
24185 #[allow(clippy::absurd_extreme_comparisons)]
24186 #[allow(unused_comparisons)]
24187 if __tmp.remaining() < Self::ENCODED_LEN {
24188 panic!(
24189 "buffer is too small (need {} bytes, but got {})",
24190 Self::ENCODED_LEN,
24191 __tmp.remaining(),
24192 )
24193 }
24194 __tmp.put_u16_le(self.param_count);
24195 __tmp.put_u16_le(self.param_index);
24196 for val in &self.param_id {
24197 __tmp.put_u8(*val);
24198 }
24199 for val in &self.param_value {
24200 __tmp.put_u8(*val);
24201 }
24202 __tmp.put_u8(self.param_type as u8);
24203 if matches!(version, MavlinkVersion::V2) {
24204 let len = __tmp.len();
24205 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24206 } else {
24207 __tmp.len()
24208 }
24209 }
24210}
24211#[doc = "Bind a RC channel to a parameter. The parameter should change according to the RC channel value."]
24212#[doc = ""]
24213#[doc = "ID: 50"]
24214#[derive(Debug, Clone, PartialEq)]
24215#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24216#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24217#[cfg_attr(feature = "ts", derive(TS))]
24218#[cfg_attr(feature = "ts", ts(export))]
24219pub struct PARAM_MAP_RC_DATA {
24220 #[doc = "Initial parameter value"]
24221 pub param_value0: f32,
24222 #[doc = "Scale, maps the RC range [-1, 1] to a parameter value"]
24223 pub scale: f32,
24224 #[doc = "Minimum param value. The protocol does not define if this overwrites an onboard minimum value. (Depends on implementation)"]
24225 pub param_value_min: f32,
24226 #[doc = "Maximum param value. The protocol does not define if this overwrites an onboard maximum value. (Depends on implementation)"]
24227 pub param_value_max: f32,
24228 #[doc = "Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored), send -2 to disable any existing map for this rc_channel_index."]
24229 pub param_index: i16,
24230 #[doc = "System ID"]
24231 pub target_system: u8,
24232 #[doc = "Component ID"]
24233 pub target_component: u8,
24234 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
24235 #[cfg_attr(
24236 feature = "serde",
24237 serde(
24238 serialize_with = "crate::nulstr::serialize::<_, 16>",
24239 deserialize_with = "crate::nulstr::deserialize::<_, 16>"
24240 )
24241 )]
24242 #[cfg_attr(feature = "ts", ts(type = "string"))]
24243 pub param_id: [u8; 16],
24244 #[doc = "Index of parameter RC channel. Not equal to the RC channel id. Typically corresponds to a potentiometer-knob on the RC."]
24245 pub parameter_rc_channel_index: u8,
24246}
24247impl PARAM_MAP_RC_DATA {
24248 pub const ENCODED_LEN: usize = 37usize;
24249 pub const DEFAULT: Self = Self {
24250 param_value0: 0.0_f32,
24251 scale: 0.0_f32,
24252 param_value_min: 0.0_f32,
24253 param_value_max: 0.0_f32,
24254 param_index: 0_i16,
24255 target_system: 0_u8,
24256 target_component: 0_u8,
24257 param_id: [0_u8; 16usize],
24258 parameter_rc_channel_index: 0_u8,
24259 };
24260 #[cfg(feature = "arbitrary")]
24261 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24262 use arbitrary::{Arbitrary, Unstructured};
24263 let mut buf = [0u8; 1024];
24264 rng.fill_bytes(&mut buf);
24265 let mut unstructured = Unstructured::new(&buf);
24266 Self::arbitrary(&mut unstructured).unwrap_or_default()
24267 }
24268}
24269impl Default for PARAM_MAP_RC_DATA {
24270 fn default() -> Self {
24271 Self::DEFAULT.clone()
24272 }
24273}
24274impl MessageData for PARAM_MAP_RC_DATA {
24275 type Message = MavMessage;
24276 const ID: u32 = 50u32;
24277 const NAME: &'static str = "PARAM_MAP_RC";
24278 const EXTRA_CRC: u8 = 78u8;
24279 const ENCODED_LEN: usize = 37usize;
24280 fn deser(
24281 _version: MavlinkVersion,
24282 __input: &[u8],
24283 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24284 let avail_len = __input.len();
24285 let mut payload_buf = [0; Self::ENCODED_LEN];
24286 let mut buf = if avail_len < Self::ENCODED_LEN {
24287 payload_buf[0..avail_len].copy_from_slice(__input);
24288 Bytes::new(&payload_buf)
24289 } else {
24290 Bytes::new(__input)
24291 };
24292 let mut __struct = Self::default();
24293 __struct.param_value0 = buf.get_f32_le();
24294 __struct.scale = buf.get_f32_le();
24295 __struct.param_value_min = buf.get_f32_le();
24296 __struct.param_value_max = buf.get_f32_le();
24297 __struct.param_index = buf.get_i16_le();
24298 __struct.target_system = buf.get_u8();
24299 __struct.target_component = buf.get_u8();
24300 for v in &mut __struct.param_id {
24301 let val = buf.get_u8();
24302 *v = val;
24303 }
24304 __struct.parameter_rc_channel_index = buf.get_u8();
24305 Ok(__struct)
24306 }
24307 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24308 let mut __tmp = BytesMut::new(bytes);
24309 #[allow(clippy::absurd_extreme_comparisons)]
24310 #[allow(unused_comparisons)]
24311 if __tmp.remaining() < Self::ENCODED_LEN {
24312 panic!(
24313 "buffer is too small (need {} bytes, but got {})",
24314 Self::ENCODED_LEN,
24315 __tmp.remaining(),
24316 )
24317 }
24318 __tmp.put_f32_le(self.param_value0);
24319 __tmp.put_f32_le(self.scale);
24320 __tmp.put_f32_le(self.param_value_min);
24321 __tmp.put_f32_le(self.param_value_max);
24322 __tmp.put_i16_le(self.param_index);
24323 __tmp.put_u8(self.target_system);
24324 __tmp.put_u8(self.target_component);
24325 for val in &self.param_id {
24326 __tmp.put_u8(*val);
24327 }
24328 __tmp.put_u8(self.parameter_rc_channel_index);
24329 if matches!(version, MavlinkVersion::V2) {
24330 let len = __tmp.len();
24331 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24332 } else {
24333 __tmp.len()
24334 }
24335 }
24336}
24337#[doc = "Request all parameters of this component. After this request, all parameters are emitted. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
24338#[doc = ""]
24339#[doc = "ID: 21"]
24340#[derive(Debug, Clone, PartialEq)]
24341#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24342#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24343#[cfg_attr(feature = "ts", derive(TS))]
24344#[cfg_attr(feature = "ts", ts(export))]
24345pub struct PARAM_REQUEST_LIST_DATA {
24346 #[doc = "System ID"]
24347 pub target_system: u8,
24348 #[doc = "Component ID"]
24349 pub target_component: u8,
24350}
24351impl PARAM_REQUEST_LIST_DATA {
24352 pub const ENCODED_LEN: usize = 2usize;
24353 pub const DEFAULT: Self = Self {
24354 target_system: 0_u8,
24355 target_component: 0_u8,
24356 };
24357 #[cfg(feature = "arbitrary")]
24358 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24359 use arbitrary::{Arbitrary, Unstructured};
24360 let mut buf = [0u8; 1024];
24361 rng.fill_bytes(&mut buf);
24362 let mut unstructured = Unstructured::new(&buf);
24363 Self::arbitrary(&mut unstructured).unwrap_or_default()
24364 }
24365}
24366impl Default for PARAM_REQUEST_LIST_DATA {
24367 fn default() -> Self {
24368 Self::DEFAULT.clone()
24369 }
24370}
24371impl MessageData for PARAM_REQUEST_LIST_DATA {
24372 type Message = MavMessage;
24373 const ID: u32 = 21u32;
24374 const NAME: &'static str = "PARAM_REQUEST_LIST";
24375 const EXTRA_CRC: u8 = 159u8;
24376 const ENCODED_LEN: usize = 2usize;
24377 fn deser(
24378 _version: MavlinkVersion,
24379 __input: &[u8],
24380 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24381 let avail_len = __input.len();
24382 let mut payload_buf = [0; Self::ENCODED_LEN];
24383 let mut buf = if avail_len < Self::ENCODED_LEN {
24384 payload_buf[0..avail_len].copy_from_slice(__input);
24385 Bytes::new(&payload_buf)
24386 } else {
24387 Bytes::new(__input)
24388 };
24389 let mut __struct = Self::default();
24390 __struct.target_system = buf.get_u8();
24391 __struct.target_component = buf.get_u8();
24392 Ok(__struct)
24393 }
24394 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24395 let mut __tmp = BytesMut::new(bytes);
24396 #[allow(clippy::absurd_extreme_comparisons)]
24397 #[allow(unused_comparisons)]
24398 if __tmp.remaining() < Self::ENCODED_LEN {
24399 panic!(
24400 "buffer is too small (need {} bytes, but got {})",
24401 Self::ENCODED_LEN,
24402 __tmp.remaining(),
24403 )
24404 }
24405 __tmp.put_u8(self.target_system);
24406 __tmp.put_u8(self.target_component);
24407 if matches!(version, MavlinkVersion::V2) {
24408 let len = __tmp.len();
24409 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24410 } else {
24411 __tmp.len()
24412 }
24413 }
24414}
24415#[doc = "value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also <https://mavlink.io/en/services/parameter.html> for a full documentation of QGroundControl and IMU code."]
24416#[doc = ""]
24417#[doc = "ID: 20"]
24418#[derive(Debug, Clone, PartialEq)]
24419#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24420#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24421#[cfg_attr(feature = "ts", derive(TS))]
24422#[cfg_attr(feature = "ts", ts(export))]
24423pub struct PARAM_REQUEST_READ_DATA {
24424 #[doc = "Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored)"]
24425 pub param_index: i16,
24426 #[doc = "System ID"]
24427 pub target_system: u8,
24428 #[doc = "Component ID"]
24429 pub target_component: u8,
24430 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
24431 #[cfg_attr(
24432 feature = "serde",
24433 serde(
24434 serialize_with = "crate::nulstr::serialize::<_, 16>",
24435 deserialize_with = "crate::nulstr::deserialize::<_, 16>"
24436 )
24437 )]
24438 #[cfg_attr(feature = "ts", ts(type = "string"))]
24439 pub param_id: [u8; 16],
24440}
24441impl PARAM_REQUEST_READ_DATA {
24442 pub const ENCODED_LEN: usize = 20usize;
24443 pub const DEFAULT: Self = Self {
24444 param_index: 0_i16,
24445 target_system: 0_u8,
24446 target_component: 0_u8,
24447 param_id: [0_u8; 16usize],
24448 };
24449 #[cfg(feature = "arbitrary")]
24450 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24451 use arbitrary::{Arbitrary, Unstructured};
24452 let mut buf = [0u8; 1024];
24453 rng.fill_bytes(&mut buf);
24454 let mut unstructured = Unstructured::new(&buf);
24455 Self::arbitrary(&mut unstructured).unwrap_or_default()
24456 }
24457}
24458impl Default for PARAM_REQUEST_READ_DATA {
24459 fn default() -> Self {
24460 Self::DEFAULT.clone()
24461 }
24462}
24463impl MessageData for PARAM_REQUEST_READ_DATA {
24464 type Message = MavMessage;
24465 const ID: u32 = 20u32;
24466 const NAME: &'static str = "PARAM_REQUEST_READ";
24467 const EXTRA_CRC: u8 = 214u8;
24468 const ENCODED_LEN: usize = 20usize;
24469 fn deser(
24470 _version: MavlinkVersion,
24471 __input: &[u8],
24472 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24473 let avail_len = __input.len();
24474 let mut payload_buf = [0; Self::ENCODED_LEN];
24475 let mut buf = if avail_len < Self::ENCODED_LEN {
24476 payload_buf[0..avail_len].copy_from_slice(__input);
24477 Bytes::new(&payload_buf)
24478 } else {
24479 Bytes::new(__input)
24480 };
24481 let mut __struct = Self::default();
24482 __struct.param_index = buf.get_i16_le();
24483 __struct.target_system = buf.get_u8();
24484 __struct.target_component = buf.get_u8();
24485 for v in &mut __struct.param_id {
24486 let val = buf.get_u8();
24487 *v = val;
24488 }
24489 Ok(__struct)
24490 }
24491 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24492 let mut __tmp = BytesMut::new(bytes);
24493 #[allow(clippy::absurd_extreme_comparisons)]
24494 #[allow(unused_comparisons)]
24495 if __tmp.remaining() < Self::ENCODED_LEN {
24496 panic!(
24497 "buffer is too small (need {} bytes, but got {})",
24498 Self::ENCODED_LEN,
24499 __tmp.remaining(),
24500 )
24501 }
24502 __tmp.put_i16_le(self.param_index);
24503 __tmp.put_u8(self.target_system);
24504 __tmp.put_u8(self.target_component);
24505 for val in &self.param_id {
24506 __tmp.put_u8(*val);
24507 }
24508 if matches!(version, MavlinkVersion::V2) {
24509 let len = __tmp.len();
24510 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24511 } else {
24512 __tmp.len()
24513 }
24514 }
24515}
24516#[doc = "Set a parameter value (write new value to permanent storage). The receiving component should acknowledge the new parameter value by broadcasting a PARAM_VALUE message (broadcasting ensures that multiple GCS all have an up-to-date list of all parameters). If the sending GCS did not receive a PARAM_VALUE within its timeout time, it should re-send the PARAM_SET message. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
24517#[doc = ""]
24518#[doc = "ID: 23"]
24519#[derive(Debug, Clone, PartialEq)]
24520#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24521#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24522#[cfg_attr(feature = "ts", derive(TS))]
24523#[cfg_attr(feature = "ts", ts(export))]
24524pub struct PARAM_SET_DATA {
24525 #[doc = "Onboard parameter value"]
24526 pub param_value: f32,
24527 #[doc = "System ID"]
24528 pub target_system: u8,
24529 #[doc = "Component ID"]
24530 pub target_component: u8,
24531 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
24532 #[cfg_attr(
24533 feature = "serde",
24534 serde(
24535 serialize_with = "crate::nulstr::serialize::<_, 16>",
24536 deserialize_with = "crate::nulstr::deserialize::<_, 16>"
24537 )
24538 )]
24539 #[cfg_attr(feature = "ts", ts(type = "string"))]
24540 pub param_id: [u8; 16],
24541 #[doc = "Onboard parameter type."]
24542 pub param_type: MavParamType,
24543}
24544impl PARAM_SET_DATA {
24545 pub const ENCODED_LEN: usize = 23usize;
24546 pub const DEFAULT: Self = Self {
24547 param_value: 0.0_f32,
24548 target_system: 0_u8,
24549 target_component: 0_u8,
24550 param_id: [0_u8; 16usize],
24551 param_type: MavParamType::DEFAULT,
24552 };
24553 #[cfg(feature = "arbitrary")]
24554 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24555 use arbitrary::{Arbitrary, Unstructured};
24556 let mut buf = [0u8; 1024];
24557 rng.fill_bytes(&mut buf);
24558 let mut unstructured = Unstructured::new(&buf);
24559 Self::arbitrary(&mut unstructured).unwrap_or_default()
24560 }
24561}
24562impl Default for PARAM_SET_DATA {
24563 fn default() -> Self {
24564 Self::DEFAULT.clone()
24565 }
24566}
24567impl MessageData for PARAM_SET_DATA {
24568 type Message = MavMessage;
24569 const ID: u32 = 23u32;
24570 const NAME: &'static str = "PARAM_SET";
24571 const EXTRA_CRC: u8 = 168u8;
24572 const ENCODED_LEN: usize = 23usize;
24573 fn deser(
24574 _version: MavlinkVersion,
24575 __input: &[u8],
24576 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24577 let avail_len = __input.len();
24578 let mut payload_buf = [0; Self::ENCODED_LEN];
24579 let mut buf = if avail_len < Self::ENCODED_LEN {
24580 payload_buf[0..avail_len].copy_from_slice(__input);
24581 Bytes::new(&payload_buf)
24582 } else {
24583 Bytes::new(__input)
24584 };
24585 let mut __struct = Self::default();
24586 __struct.param_value = buf.get_f32_le();
24587 __struct.target_system = buf.get_u8();
24588 __struct.target_component = buf.get_u8();
24589 for v in &mut __struct.param_id {
24590 let val = buf.get_u8();
24591 *v = val;
24592 }
24593 let tmp = buf.get_u8();
24594 __struct.param_type =
24595 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24596 enum_type: "MavParamType",
24597 value: tmp as u32,
24598 })?;
24599 Ok(__struct)
24600 }
24601 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24602 let mut __tmp = BytesMut::new(bytes);
24603 #[allow(clippy::absurd_extreme_comparisons)]
24604 #[allow(unused_comparisons)]
24605 if __tmp.remaining() < Self::ENCODED_LEN {
24606 panic!(
24607 "buffer is too small (need {} bytes, but got {})",
24608 Self::ENCODED_LEN,
24609 __tmp.remaining(),
24610 )
24611 }
24612 __tmp.put_f32_le(self.param_value);
24613 __tmp.put_u8(self.target_system);
24614 __tmp.put_u8(self.target_component);
24615 for val in &self.param_id {
24616 __tmp.put_u8(*val);
24617 }
24618 __tmp.put_u8(self.param_type as u8);
24619 if matches!(version, MavlinkVersion::V2) {
24620 let len = __tmp.len();
24621 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24622 } else {
24623 __tmp.len()
24624 }
24625 }
24626}
24627#[doc = "Emit the value of a onboard parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows him to re-request missing parameters after a loss or timeout. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
24628#[doc = ""]
24629#[doc = "ID: 22"]
24630#[derive(Debug, Clone, PartialEq)]
24631#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24632#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24633#[cfg_attr(feature = "ts", derive(TS))]
24634#[cfg_attr(feature = "ts", ts(export))]
24635pub struct PARAM_VALUE_DATA {
24636 #[doc = "Onboard parameter value"]
24637 pub param_value: f32,
24638 #[doc = "Total number of onboard parameters"]
24639 pub param_count: u16,
24640 #[doc = "Index of this onboard parameter"]
24641 pub param_index: u16,
24642 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
24643 #[cfg_attr(
24644 feature = "serde",
24645 serde(
24646 serialize_with = "crate::nulstr::serialize::<_, 16>",
24647 deserialize_with = "crate::nulstr::deserialize::<_, 16>"
24648 )
24649 )]
24650 #[cfg_attr(feature = "ts", ts(type = "string"))]
24651 pub param_id: [u8; 16],
24652 #[doc = "Onboard parameter type."]
24653 pub param_type: MavParamType,
24654}
24655impl PARAM_VALUE_DATA {
24656 pub const ENCODED_LEN: usize = 25usize;
24657 pub const DEFAULT: Self = Self {
24658 param_value: 0.0_f32,
24659 param_count: 0_u16,
24660 param_index: 0_u16,
24661 param_id: [0_u8; 16usize],
24662 param_type: MavParamType::DEFAULT,
24663 };
24664 #[cfg(feature = "arbitrary")]
24665 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24666 use arbitrary::{Arbitrary, Unstructured};
24667 let mut buf = [0u8; 1024];
24668 rng.fill_bytes(&mut buf);
24669 let mut unstructured = Unstructured::new(&buf);
24670 Self::arbitrary(&mut unstructured).unwrap_or_default()
24671 }
24672}
24673impl Default for PARAM_VALUE_DATA {
24674 fn default() -> Self {
24675 Self::DEFAULT.clone()
24676 }
24677}
24678impl MessageData for PARAM_VALUE_DATA {
24679 type Message = MavMessage;
24680 const ID: u32 = 22u32;
24681 const NAME: &'static str = "PARAM_VALUE";
24682 const EXTRA_CRC: u8 = 220u8;
24683 const ENCODED_LEN: usize = 25usize;
24684 fn deser(
24685 _version: MavlinkVersion,
24686 __input: &[u8],
24687 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24688 let avail_len = __input.len();
24689 let mut payload_buf = [0; Self::ENCODED_LEN];
24690 let mut buf = if avail_len < Self::ENCODED_LEN {
24691 payload_buf[0..avail_len].copy_from_slice(__input);
24692 Bytes::new(&payload_buf)
24693 } else {
24694 Bytes::new(__input)
24695 };
24696 let mut __struct = Self::default();
24697 __struct.param_value = buf.get_f32_le();
24698 __struct.param_count = buf.get_u16_le();
24699 __struct.param_index = buf.get_u16_le();
24700 for v in &mut __struct.param_id {
24701 let val = buf.get_u8();
24702 *v = val;
24703 }
24704 let tmp = buf.get_u8();
24705 __struct.param_type =
24706 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24707 enum_type: "MavParamType",
24708 value: tmp as u32,
24709 })?;
24710 Ok(__struct)
24711 }
24712 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24713 let mut __tmp = BytesMut::new(bytes);
24714 #[allow(clippy::absurd_extreme_comparisons)]
24715 #[allow(unused_comparisons)]
24716 if __tmp.remaining() < Self::ENCODED_LEN {
24717 panic!(
24718 "buffer is too small (need {} bytes, but got {})",
24719 Self::ENCODED_LEN,
24720 __tmp.remaining(),
24721 )
24722 }
24723 __tmp.put_f32_le(self.param_value);
24724 __tmp.put_u16_le(self.param_count);
24725 __tmp.put_u16_le(self.param_index);
24726 for val in &self.param_id {
24727 __tmp.put_u8(*val);
24728 }
24729 __tmp.put_u8(self.param_type as u8);
24730 if matches!(version, MavlinkVersion::V2) {
24731 let len = __tmp.len();
24732 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24733 } else {
24734 __tmp.len()
24735 }
24736 }
24737}
24738#[deprecated = "To be removed / merged with TIMESYNC. See `TIMESYNC` (Deprecated since 2011-08)"]
24739#[doc = "A ping message either requesting or responding to a ping. This allows to measure the system latencies, including serial port, radio modem and UDP connections. The ping microservice is documented at <https://mavlink.io/en/services/ping.html>."]
24740#[doc = ""]
24741#[doc = "ID: 4"]
24742#[derive(Debug, Clone, PartialEq)]
24743#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24744#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24745#[cfg_attr(feature = "ts", derive(TS))]
24746#[cfg_attr(feature = "ts", ts(export))]
24747pub struct PING_DATA {
24748 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
24749 pub time_usec: u64,
24750 #[doc = "PING sequence"]
24751 pub seq: u32,
24752 #[doc = "0: request ping from all receiving systems. If greater than 0: message is a ping response and number is the system id of the requesting system"]
24753 pub target_system: u8,
24754 #[doc = "0: request ping from all receiving components. If greater than 0: message is a ping response and number is the component id of the requesting component."]
24755 pub target_component: u8,
24756}
24757impl PING_DATA {
24758 pub const ENCODED_LEN: usize = 14usize;
24759 pub const DEFAULT: Self = Self {
24760 time_usec: 0_u64,
24761 seq: 0_u32,
24762 target_system: 0_u8,
24763 target_component: 0_u8,
24764 };
24765 #[cfg(feature = "arbitrary")]
24766 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24767 use arbitrary::{Arbitrary, Unstructured};
24768 let mut buf = [0u8; 1024];
24769 rng.fill_bytes(&mut buf);
24770 let mut unstructured = Unstructured::new(&buf);
24771 Self::arbitrary(&mut unstructured).unwrap_or_default()
24772 }
24773}
24774impl Default for PING_DATA {
24775 fn default() -> Self {
24776 Self::DEFAULT.clone()
24777 }
24778}
24779impl MessageData for PING_DATA {
24780 type Message = MavMessage;
24781 const ID: u32 = 4u32;
24782 const NAME: &'static str = "PING";
24783 const EXTRA_CRC: u8 = 237u8;
24784 const ENCODED_LEN: usize = 14usize;
24785 fn deser(
24786 _version: MavlinkVersion,
24787 __input: &[u8],
24788 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24789 let avail_len = __input.len();
24790 let mut payload_buf = [0; Self::ENCODED_LEN];
24791 let mut buf = if avail_len < Self::ENCODED_LEN {
24792 payload_buf[0..avail_len].copy_from_slice(__input);
24793 Bytes::new(&payload_buf)
24794 } else {
24795 Bytes::new(__input)
24796 };
24797 let mut __struct = Self::default();
24798 __struct.time_usec = buf.get_u64_le();
24799 __struct.seq = buf.get_u32_le();
24800 __struct.target_system = buf.get_u8();
24801 __struct.target_component = buf.get_u8();
24802 Ok(__struct)
24803 }
24804 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24805 let mut __tmp = BytesMut::new(bytes);
24806 #[allow(clippy::absurd_extreme_comparisons)]
24807 #[allow(unused_comparisons)]
24808 if __tmp.remaining() < Self::ENCODED_LEN {
24809 panic!(
24810 "buffer is too small (need {} bytes, but got {})",
24811 Self::ENCODED_LEN,
24812 __tmp.remaining(),
24813 )
24814 }
24815 __tmp.put_u64_le(self.time_usec);
24816 __tmp.put_u32_le(self.seq);
24817 __tmp.put_u8(self.target_system);
24818 __tmp.put_u8(self.target_component);
24819 if matches!(version, MavlinkVersion::V2) {
24820 let len = __tmp.len();
24821 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24822 } else {
24823 __tmp.len()
24824 }
24825 }
24826}
24827#[deprecated = "New version explicitly defines format. More interoperable. See `PLAY_TUNE_V2` (Deprecated since 2019-10)"]
24828#[doc = "Control vehicle tone generation (buzzer)."]
24829#[doc = ""]
24830#[doc = "ID: 258"]
24831#[derive(Debug, Clone, PartialEq)]
24832#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24833#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24834#[cfg_attr(feature = "ts", derive(TS))]
24835#[cfg_attr(feature = "ts", ts(export))]
24836pub struct PLAY_TUNE_DATA {
24837 #[doc = "System ID"]
24838 pub target_system: u8,
24839 #[doc = "Component ID"]
24840 pub target_component: u8,
24841 #[doc = "tune in board specific format"]
24842 #[cfg_attr(
24843 feature = "serde",
24844 serde(
24845 serialize_with = "crate::nulstr::serialize::<_, 30>",
24846 deserialize_with = "crate::nulstr::deserialize::<_, 30>"
24847 )
24848 )]
24849 #[cfg_attr(feature = "ts", ts(type = "string"))]
24850 pub tune: [u8; 30],
24851 #[doc = "tune extension (appended to tune)"]
24852 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24853 #[cfg_attr(
24854 feature = "serde",
24855 serde(
24856 serialize_with = "crate::nulstr::serialize::<_, 200>",
24857 deserialize_with = "crate::nulstr::deserialize::<_, 200>"
24858 )
24859 )]
24860 #[cfg_attr(feature = "ts", ts(type = "string"))]
24861 pub tune2: [u8; 200],
24862}
24863impl PLAY_TUNE_DATA {
24864 pub const ENCODED_LEN: usize = 232usize;
24865 pub const DEFAULT: Self = Self {
24866 target_system: 0_u8,
24867 target_component: 0_u8,
24868 tune: [0_u8; 30usize],
24869 tune2: [0_u8; 200usize],
24870 };
24871 #[cfg(feature = "arbitrary")]
24872 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24873 use arbitrary::{Arbitrary, Unstructured};
24874 let mut buf = [0u8; 1024];
24875 rng.fill_bytes(&mut buf);
24876 let mut unstructured = Unstructured::new(&buf);
24877 Self::arbitrary(&mut unstructured).unwrap_or_default()
24878 }
24879}
24880impl Default for PLAY_TUNE_DATA {
24881 fn default() -> Self {
24882 Self::DEFAULT.clone()
24883 }
24884}
24885impl MessageData for PLAY_TUNE_DATA {
24886 type Message = MavMessage;
24887 const ID: u32 = 258u32;
24888 const NAME: &'static str = "PLAY_TUNE";
24889 const EXTRA_CRC: u8 = 187u8;
24890 const ENCODED_LEN: usize = 232usize;
24891 fn deser(
24892 _version: MavlinkVersion,
24893 __input: &[u8],
24894 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24895 let avail_len = __input.len();
24896 let mut payload_buf = [0; Self::ENCODED_LEN];
24897 let mut buf = if avail_len < Self::ENCODED_LEN {
24898 payload_buf[0..avail_len].copy_from_slice(__input);
24899 Bytes::new(&payload_buf)
24900 } else {
24901 Bytes::new(__input)
24902 };
24903 let mut __struct = Self::default();
24904 __struct.target_system = buf.get_u8();
24905 __struct.target_component = buf.get_u8();
24906 for v in &mut __struct.tune {
24907 let val = buf.get_u8();
24908 *v = val;
24909 }
24910 for v in &mut __struct.tune2 {
24911 let val = buf.get_u8();
24912 *v = val;
24913 }
24914 Ok(__struct)
24915 }
24916 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24917 let mut __tmp = BytesMut::new(bytes);
24918 #[allow(clippy::absurd_extreme_comparisons)]
24919 #[allow(unused_comparisons)]
24920 if __tmp.remaining() < Self::ENCODED_LEN {
24921 panic!(
24922 "buffer is too small (need {} bytes, but got {})",
24923 Self::ENCODED_LEN,
24924 __tmp.remaining(),
24925 )
24926 }
24927 __tmp.put_u8(self.target_system);
24928 __tmp.put_u8(self.target_component);
24929 for val in &self.tune {
24930 __tmp.put_u8(*val);
24931 }
24932 if matches!(version, MavlinkVersion::V2) {
24933 for val in &self.tune2 {
24934 __tmp.put_u8(*val);
24935 }
24936 let len = __tmp.len();
24937 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24938 } else {
24939 __tmp.len()
24940 }
24941 }
24942}
24943#[doc = "Play vehicle tone/tune (buzzer). Supersedes message PLAY_TUNE."]
24944#[doc = ""]
24945#[doc = "ID: 400"]
24946#[derive(Debug, Clone, PartialEq)]
24947#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24948#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24949#[cfg_attr(feature = "ts", derive(TS))]
24950#[cfg_attr(feature = "ts", ts(export))]
24951pub struct PLAY_TUNE_V2_DATA {
24952 #[doc = "Tune format"]
24953 pub format: TuneFormat,
24954 #[doc = "System ID"]
24955 pub target_system: u8,
24956 #[doc = "Component ID"]
24957 pub target_component: u8,
24958 #[doc = "Tune definition as a NULL-terminated string."]
24959 #[cfg_attr(
24960 feature = "serde",
24961 serde(
24962 serialize_with = "crate::nulstr::serialize::<_, 248>",
24963 deserialize_with = "crate::nulstr::deserialize::<_, 248>"
24964 )
24965 )]
24966 #[cfg_attr(feature = "ts", ts(type = "string"))]
24967 pub tune: [u8; 248],
24968}
24969impl PLAY_TUNE_V2_DATA {
24970 pub const ENCODED_LEN: usize = 254usize;
24971 pub const DEFAULT: Self = Self {
24972 format: TuneFormat::DEFAULT,
24973 target_system: 0_u8,
24974 target_component: 0_u8,
24975 tune: [0_u8; 248usize],
24976 };
24977 #[cfg(feature = "arbitrary")]
24978 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24979 use arbitrary::{Arbitrary, Unstructured};
24980 let mut buf = [0u8; 1024];
24981 rng.fill_bytes(&mut buf);
24982 let mut unstructured = Unstructured::new(&buf);
24983 Self::arbitrary(&mut unstructured).unwrap_or_default()
24984 }
24985}
24986impl Default for PLAY_TUNE_V2_DATA {
24987 fn default() -> Self {
24988 Self::DEFAULT.clone()
24989 }
24990}
24991impl MessageData for PLAY_TUNE_V2_DATA {
24992 type Message = MavMessage;
24993 const ID: u32 = 400u32;
24994 const NAME: &'static str = "PLAY_TUNE_V2";
24995 const EXTRA_CRC: u8 = 110u8;
24996 const ENCODED_LEN: usize = 254usize;
24997 fn deser(
24998 _version: MavlinkVersion,
24999 __input: &[u8],
25000 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25001 let avail_len = __input.len();
25002 let mut payload_buf = [0; Self::ENCODED_LEN];
25003 let mut buf = if avail_len < Self::ENCODED_LEN {
25004 payload_buf[0..avail_len].copy_from_slice(__input);
25005 Bytes::new(&payload_buf)
25006 } else {
25007 Bytes::new(__input)
25008 };
25009 let mut __struct = Self::default();
25010 let tmp = buf.get_u32_le();
25011 __struct.format = FromPrimitive::from_u32(tmp).ok_or(
25012 ::mavlink_core::error::ParserError::InvalidEnum {
25013 enum_type: "TuneFormat",
25014 value: tmp as u32,
25015 },
25016 )?;
25017 __struct.target_system = buf.get_u8();
25018 __struct.target_component = buf.get_u8();
25019 for v in &mut __struct.tune {
25020 let val = buf.get_u8();
25021 *v = val;
25022 }
25023 Ok(__struct)
25024 }
25025 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25026 let mut __tmp = BytesMut::new(bytes);
25027 #[allow(clippy::absurd_extreme_comparisons)]
25028 #[allow(unused_comparisons)]
25029 if __tmp.remaining() < Self::ENCODED_LEN {
25030 panic!(
25031 "buffer is too small (need {} bytes, but got {})",
25032 Self::ENCODED_LEN,
25033 __tmp.remaining(),
25034 )
25035 }
25036 __tmp.put_u32_le(self.format as u32);
25037 __tmp.put_u8(self.target_system);
25038 __tmp.put_u8(self.target_component);
25039 for val in &self.tune {
25040 __tmp.put_u8(*val);
25041 }
25042 if matches!(version, MavlinkVersion::V2) {
25043 let len = __tmp.len();
25044 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25045 } else {
25046 __tmp.len()
25047 }
25048 }
25049}
25050#[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_GLOBAL_INT if the vehicle is being controlled this way."]
25051#[doc = ""]
25052#[doc = "ID: 87"]
25053#[derive(Debug, Clone, PartialEq)]
25054#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25055#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25056#[cfg_attr(feature = "ts", derive(TS))]
25057#[cfg_attr(feature = "ts", ts(export))]
25058pub struct POSITION_TARGET_GLOBAL_INT_DATA {
25059 #[doc = "Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency."]
25060 pub time_boot_ms: u32,
25061 #[doc = "Latitude in WGS84 frame"]
25062 pub lat_int: i32,
25063 #[doc = "Longitude in WGS84 frame"]
25064 pub lon_int: i32,
25065 #[doc = "Altitude (MSL, AGL or relative to home altitude, depending on frame)"]
25066 pub alt: f32,
25067 #[doc = "X velocity in NED frame"]
25068 pub vx: f32,
25069 #[doc = "Y velocity in NED frame"]
25070 pub vy: f32,
25071 #[doc = "Z velocity in NED frame"]
25072 pub vz: f32,
25073 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
25074 pub afx: f32,
25075 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
25076 pub afy: f32,
25077 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
25078 pub afz: f32,
25079 #[doc = "yaw setpoint"]
25080 pub yaw: f32,
25081 #[doc = "yaw rate setpoint"]
25082 pub yaw_rate: f32,
25083 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
25084 pub type_mask: PositionTargetTypemask,
25085 #[doc = "Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)"]
25086 pub coordinate_frame: MavFrame,
25087}
25088impl POSITION_TARGET_GLOBAL_INT_DATA {
25089 pub const ENCODED_LEN: usize = 51usize;
25090 pub const DEFAULT: Self = Self {
25091 time_boot_ms: 0_u32,
25092 lat_int: 0_i32,
25093 lon_int: 0_i32,
25094 alt: 0.0_f32,
25095 vx: 0.0_f32,
25096 vy: 0.0_f32,
25097 vz: 0.0_f32,
25098 afx: 0.0_f32,
25099 afy: 0.0_f32,
25100 afz: 0.0_f32,
25101 yaw: 0.0_f32,
25102 yaw_rate: 0.0_f32,
25103 type_mask: PositionTargetTypemask::DEFAULT,
25104 coordinate_frame: MavFrame::DEFAULT,
25105 };
25106 #[cfg(feature = "arbitrary")]
25107 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25108 use arbitrary::{Arbitrary, Unstructured};
25109 let mut buf = [0u8; 1024];
25110 rng.fill_bytes(&mut buf);
25111 let mut unstructured = Unstructured::new(&buf);
25112 Self::arbitrary(&mut unstructured).unwrap_or_default()
25113 }
25114}
25115impl Default for POSITION_TARGET_GLOBAL_INT_DATA {
25116 fn default() -> Self {
25117 Self::DEFAULT.clone()
25118 }
25119}
25120impl MessageData for POSITION_TARGET_GLOBAL_INT_DATA {
25121 type Message = MavMessage;
25122 const ID: u32 = 87u32;
25123 const NAME: &'static str = "POSITION_TARGET_GLOBAL_INT";
25124 const EXTRA_CRC: u8 = 150u8;
25125 const ENCODED_LEN: usize = 51usize;
25126 fn deser(
25127 _version: MavlinkVersion,
25128 __input: &[u8],
25129 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25130 let avail_len = __input.len();
25131 let mut payload_buf = [0; Self::ENCODED_LEN];
25132 let mut buf = if avail_len < Self::ENCODED_LEN {
25133 payload_buf[0..avail_len].copy_from_slice(__input);
25134 Bytes::new(&payload_buf)
25135 } else {
25136 Bytes::new(__input)
25137 };
25138 let mut __struct = Self::default();
25139 __struct.time_boot_ms = buf.get_u32_le();
25140 __struct.lat_int = buf.get_i32_le();
25141 __struct.lon_int = buf.get_i32_le();
25142 __struct.alt = buf.get_f32_le();
25143 __struct.vx = buf.get_f32_le();
25144 __struct.vy = buf.get_f32_le();
25145 __struct.vz = buf.get_f32_le();
25146 __struct.afx = buf.get_f32_le();
25147 __struct.afy = buf.get_f32_le();
25148 __struct.afz = buf.get_f32_le();
25149 __struct.yaw = buf.get_f32_le();
25150 __struct.yaw_rate = buf.get_f32_le();
25151 let tmp = buf.get_u16_le();
25152 __struct.type_mask = PositionTargetTypemask::from_bits(
25153 tmp & PositionTargetTypemask::all().bits(),
25154 )
25155 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
25156 flag_type: "PositionTargetTypemask",
25157 value: tmp as u32,
25158 })?;
25159 let tmp = buf.get_u8();
25160 __struct.coordinate_frame =
25161 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
25162 enum_type: "MavFrame",
25163 value: tmp as u32,
25164 })?;
25165 Ok(__struct)
25166 }
25167 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25168 let mut __tmp = BytesMut::new(bytes);
25169 #[allow(clippy::absurd_extreme_comparisons)]
25170 #[allow(unused_comparisons)]
25171 if __tmp.remaining() < Self::ENCODED_LEN {
25172 panic!(
25173 "buffer is too small (need {} bytes, but got {})",
25174 Self::ENCODED_LEN,
25175 __tmp.remaining(),
25176 )
25177 }
25178 __tmp.put_u32_le(self.time_boot_ms);
25179 __tmp.put_i32_le(self.lat_int);
25180 __tmp.put_i32_le(self.lon_int);
25181 __tmp.put_f32_le(self.alt);
25182 __tmp.put_f32_le(self.vx);
25183 __tmp.put_f32_le(self.vy);
25184 __tmp.put_f32_le(self.vz);
25185 __tmp.put_f32_le(self.afx);
25186 __tmp.put_f32_le(self.afy);
25187 __tmp.put_f32_le(self.afz);
25188 __tmp.put_f32_le(self.yaw);
25189 __tmp.put_f32_le(self.yaw_rate);
25190 __tmp.put_u16_le(self.type_mask.bits());
25191 __tmp.put_u8(self.coordinate_frame as u8);
25192 if matches!(version, MavlinkVersion::V2) {
25193 let len = __tmp.len();
25194 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25195 } else {
25196 __tmp.len()
25197 }
25198 }
25199}
25200#[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_LOCAL_NED if the vehicle is being controlled this way."]
25201#[doc = ""]
25202#[doc = "ID: 85"]
25203#[derive(Debug, Clone, PartialEq)]
25204#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25205#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25206#[cfg_attr(feature = "ts", derive(TS))]
25207#[cfg_attr(feature = "ts", ts(export))]
25208pub struct POSITION_TARGET_LOCAL_NED_DATA {
25209 #[doc = "Timestamp (time since system boot)."]
25210 pub time_boot_ms: u32,
25211 #[doc = "X Position in NED frame"]
25212 pub x: f32,
25213 #[doc = "Y Position in NED frame"]
25214 pub y: f32,
25215 #[doc = "Z Position in NED frame (note, altitude is negative in NED)"]
25216 pub z: f32,
25217 #[doc = "X velocity in NED frame"]
25218 pub vx: f32,
25219 #[doc = "Y velocity in NED frame"]
25220 pub vy: f32,
25221 #[doc = "Z velocity in NED frame"]
25222 pub vz: f32,
25223 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
25224 pub afx: f32,
25225 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
25226 pub afy: f32,
25227 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
25228 pub afz: f32,
25229 #[doc = "yaw setpoint"]
25230 pub yaw: f32,
25231 #[doc = "yaw rate setpoint"]
25232 pub yaw_rate: f32,
25233 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
25234 pub type_mask: PositionTargetTypemask,
25235 #[doc = "Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9"]
25236 pub coordinate_frame: MavFrame,
25237}
25238impl POSITION_TARGET_LOCAL_NED_DATA {
25239 pub const ENCODED_LEN: usize = 51usize;
25240 pub const DEFAULT: Self = Self {
25241 time_boot_ms: 0_u32,
25242 x: 0.0_f32,
25243 y: 0.0_f32,
25244 z: 0.0_f32,
25245 vx: 0.0_f32,
25246 vy: 0.0_f32,
25247 vz: 0.0_f32,
25248 afx: 0.0_f32,
25249 afy: 0.0_f32,
25250 afz: 0.0_f32,
25251 yaw: 0.0_f32,
25252 yaw_rate: 0.0_f32,
25253 type_mask: PositionTargetTypemask::DEFAULT,
25254 coordinate_frame: MavFrame::DEFAULT,
25255 };
25256 #[cfg(feature = "arbitrary")]
25257 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25258 use arbitrary::{Arbitrary, Unstructured};
25259 let mut buf = [0u8; 1024];
25260 rng.fill_bytes(&mut buf);
25261 let mut unstructured = Unstructured::new(&buf);
25262 Self::arbitrary(&mut unstructured).unwrap_or_default()
25263 }
25264}
25265impl Default for POSITION_TARGET_LOCAL_NED_DATA {
25266 fn default() -> Self {
25267 Self::DEFAULT.clone()
25268 }
25269}
25270impl MessageData for POSITION_TARGET_LOCAL_NED_DATA {
25271 type Message = MavMessage;
25272 const ID: u32 = 85u32;
25273 const NAME: &'static str = "POSITION_TARGET_LOCAL_NED";
25274 const EXTRA_CRC: u8 = 140u8;
25275 const ENCODED_LEN: usize = 51usize;
25276 fn deser(
25277 _version: MavlinkVersion,
25278 __input: &[u8],
25279 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25280 let avail_len = __input.len();
25281 let mut payload_buf = [0; Self::ENCODED_LEN];
25282 let mut buf = if avail_len < Self::ENCODED_LEN {
25283 payload_buf[0..avail_len].copy_from_slice(__input);
25284 Bytes::new(&payload_buf)
25285 } else {
25286 Bytes::new(__input)
25287 };
25288 let mut __struct = Self::default();
25289 __struct.time_boot_ms = buf.get_u32_le();
25290 __struct.x = buf.get_f32_le();
25291 __struct.y = buf.get_f32_le();
25292 __struct.z = buf.get_f32_le();
25293 __struct.vx = buf.get_f32_le();
25294 __struct.vy = buf.get_f32_le();
25295 __struct.vz = buf.get_f32_le();
25296 __struct.afx = buf.get_f32_le();
25297 __struct.afy = buf.get_f32_le();
25298 __struct.afz = buf.get_f32_le();
25299 __struct.yaw = buf.get_f32_le();
25300 __struct.yaw_rate = buf.get_f32_le();
25301 let tmp = buf.get_u16_le();
25302 __struct.type_mask = PositionTargetTypemask::from_bits(
25303 tmp & PositionTargetTypemask::all().bits(),
25304 )
25305 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
25306 flag_type: "PositionTargetTypemask",
25307 value: tmp as u32,
25308 })?;
25309 let tmp = buf.get_u8();
25310 __struct.coordinate_frame =
25311 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
25312 enum_type: "MavFrame",
25313 value: tmp as u32,
25314 })?;
25315 Ok(__struct)
25316 }
25317 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25318 let mut __tmp = BytesMut::new(bytes);
25319 #[allow(clippy::absurd_extreme_comparisons)]
25320 #[allow(unused_comparisons)]
25321 if __tmp.remaining() < Self::ENCODED_LEN {
25322 panic!(
25323 "buffer is too small (need {} bytes, but got {})",
25324 Self::ENCODED_LEN,
25325 __tmp.remaining(),
25326 )
25327 }
25328 __tmp.put_u32_le(self.time_boot_ms);
25329 __tmp.put_f32_le(self.x);
25330 __tmp.put_f32_le(self.y);
25331 __tmp.put_f32_le(self.z);
25332 __tmp.put_f32_le(self.vx);
25333 __tmp.put_f32_le(self.vy);
25334 __tmp.put_f32_le(self.vz);
25335 __tmp.put_f32_le(self.afx);
25336 __tmp.put_f32_le(self.afy);
25337 __tmp.put_f32_le(self.afz);
25338 __tmp.put_f32_le(self.yaw);
25339 __tmp.put_f32_le(self.yaw_rate);
25340 __tmp.put_u16_le(self.type_mask.bits());
25341 __tmp.put_u8(self.coordinate_frame as u8);
25342 if matches!(version, MavlinkVersion::V2) {
25343 let len = __tmp.len();
25344 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25345 } else {
25346 __tmp.len()
25347 }
25348 }
25349}
25350#[doc = "Power supply status."]
25351#[doc = ""]
25352#[doc = "ID: 125"]
25353#[derive(Debug, Clone, PartialEq)]
25354#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25355#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25356#[cfg_attr(feature = "ts", derive(TS))]
25357#[cfg_attr(feature = "ts", ts(export))]
25358pub struct POWER_STATUS_DATA {
25359 #[doc = "5V rail voltage."]
25360 pub Vcc: u16,
25361 #[doc = "Servo rail voltage."]
25362 pub Vservo: u16,
25363 #[doc = "Bitmap of power supply status flags."]
25364 pub flags: MavPowerStatus,
25365}
25366impl POWER_STATUS_DATA {
25367 pub const ENCODED_LEN: usize = 6usize;
25368 pub const DEFAULT: Self = Self {
25369 Vcc: 0_u16,
25370 Vservo: 0_u16,
25371 flags: MavPowerStatus::DEFAULT,
25372 };
25373 #[cfg(feature = "arbitrary")]
25374 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25375 use arbitrary::{Arbitrary, Unstructured};
25376 let mut buf = [0u8; 1024];
25377 rng.fill_bytes(&mut buf);
25378 let mut unstructured = Unstructured::new(&buf);
25379 Self::arbitrary(&mut unstructured).unwrap_or_default()
25380 }
25381}
25382impl Default for POWER_STATUS_DATA {
25383 fn default() -> Self {
25384 Self::DEFAULT.clone()
25385 }
25386}
25387impl MessageData for POWER_STATUS_DATA {
25388 type Message = MavMessage;
25389 const ID: u32 = 125u32;
25390 const NAME: &'static str = "POWER_STATUS";
25391 const EXTRA_CRC: u8 = 203u8;
25392 const ENCODED_LEN: usize = 6usize;
25393 fn deser(
25394 _version: MavlinkVersion,
25395 __input: &[u8],
25396 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25397 let avail_len = __input.len();
25398 let mut payload_buf = [0; Self::ENCODED_LEN];
25399 let mut buf = if avail_len < Self::ENCODED_LEN {
25400 payload_buf[0..avail_len].copy_from_slice(__input);
25401 Bytes::new(&payload_buf)
25402 } else {
25403 Bytes::new(__input)
25404 };
25405 let mut __struct = Self::default();
25406 __struct.Vcc = buf.get_u16_le();
25407 __struct.Vservo = buf.get_u16_le();
25408 let tmp = buf.get_u16_le();
25409 __struct.flags = MavPowerStatus::from_bits(tmp & MavPowerStatus::all().bits()).ok_or(
25410 ::mavlink_core::error::ParserError::InvalidFlag {
25411 flag_type: "MavPowerStatus",
25412 value: tmp as u32,
25413 },
25414 )?;
25415 Ok(__struct)
25416 }
25417 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25418 let mut __tmp = BytesMut::new(bytes);
25419 #[allow(clippy::absurd_extreme_comparisons)]
25420 #[allow(unused_comparisons)]
25421 if __tmp.remaining() < Self::ENCODED_LEN {
25422 panic!(
25423 "buffer is too small (need {} bytes, but got {})",
25424 Self::ENCODED_LEN,
25425 __tmp.remaining(),
25426 )
25427 }
25428 __tmp.put_u16_le(self.Vcc);
25429 __tmp.put_u16_le(self.Vservo);
25430 __tmp.put_u16_le(self.flags.bits());
25431 if matches!(version, MavlinkVersion::V2) {
25432 let len = __tmp.len();
25433 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25434 } else {
25435 __tmp.len()
25436 }
25437 }
25438}
25439#[doc = "Version and capability of protocol version. This message can be requested with MAV_CMD_REQUEST_MESSAGE and is used as part of the handshaking to establish which MAVLink version should be used on the network. Every node should respond to a request for PROTOCOL_VERSION to enable the handshaking. Library implementers should consider adding this into the default decoding state machine to allow the protocol core to respond directly."]
25440#[doc = ""]
25441#[doc = "ID: 300"]
25442#[derive(Debug, Clone, PartialEq)]
25443#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25444#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25445#[cfg_attr(feature = "ts", derive(TS))]
25446#[cfg_attr(feature = "ts", ts(export))]
25447pub struct PROTOCOL_VERSION_DATA {
25448 #[doc = "Currently active MAVLink version number * 100: v1.0 is 100, v2.0 is 200, etc."]
25449 pub version: u16,
25450 #[doc = "Minimum MAVLink version supported"]
25451 pub min_version: u16,
25452 #[doc = "Maximum MAVLink version supported (set to the same value as version by default)"]
25453 pub max_version: u16,
25454 #[doc = "The first 8 bytes (not characters printed in hex!) of the git hash."]
25455 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
25456 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
25457 pub spec_version_hash: [u8; 8],
25458 #[doc = "The first 8 bytes (not characters printed in hex!) of the git hash."]
25459 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
25460 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
25461 pub library_version_hash: [u8; 8],
25462}
25463impl PROTOCOL_VERSION_DATA {
25464 pub const ENCODED_LEN: usize = 22usize;
25465 pub const DEFAULT: Self = Self {
25466 version: 0_u16,
25467 min_version: 0_u16,
25468 max_version: 0_u16,
25469 spec_version_hash: [0_u8; 8usize],
25470 library_version_hash: [0_u8; 8usize],
25471 };
25472 #[cfg(feature = "arbitrary")]
25473 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25474 use arbitrary::{Arbitrary, Unstructured};
25475 let mut buf = [0u8; 1024];
25476 rng.fill_bytes(&mut buf);
25477 let mut unstructured = Unstructured::new(&buf);
25478 Self::arbitrary(&mut unstructured).unwrap_or_default()
25479 }
25480}
25481impl Default for PROTOCOL_VERSION_DATA {
25482 fn default() -> Self {
25483 Self::DEFAULT.clone()
25484 }
25485}
25486impl MessageData for PROTOCOL_VERSION_DATA {
25487 type Message = MavMessage;
25488 const ID: u32 = 300u32;
25489 const NAME: &'static str = "PROTOCOL_VERSION";
25490 const EXTRA_CRC: u8 = 217u8;
25491 const ENCODED_LEN: usize = 22usize;
25492 fn deser(
25493 _version: MavlinkVersion,
25494 __input: &[u8],
25495 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25496 let avail_len = __input.len();
25497 let mut payload_buf = [0; Self::ENCODED_LEN];
25498 let mut buf = if avail_len < Self::ENCODED_LEN {
25499 payload_buf[0..avail_len].copy_from_slice(__input);
25500 Bytes::new(&payload_buf)
25501 } else {
25502 Bytes::new(__input)
25503 };
25504 let mut __struct = Self::default();
25505 __struct.version = buf.get_u16_le();
25506 __struct.min_version = buf.get_u16_le();
25507 __struct.max_version = buf.get_u16_le();
25508 for v in &mut __struct.spec_version_hash {
25509 let val = buf.get_u8();
25510 *v = val;
25511 }
25512 for v in &mut __struct.library_version_hash {
25513 let val = buf.get_u8();
25514 *v = val;
25515 }
25516 Ok(__struct)
25517 }
25518 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25519 let mut __tmp = BytesMut::new(bytes);
25520 #[allow(clippy::absurd_extreme_comparisons)]
25521 #[allow(unused_comparisons)]
25522 if __tmp.remaining() < Self::ENCODED_LEN {
25523 panic!(
25524 "buffer is too small (need {} bytes, but got {})",
25525 Self::ENCODED_LEN,
25526 __tmp.remaining(),
25527 )
25528 }
25529 __tmp.put_u16_le(self.version);
25530 __tmp.put_u16_le(self.min_version);
25531 __tmp.put_u16_le(self.max_version);
25532 for val in &self.spec_version_hash {
25533 __tmp.put_u8(*val);
25534 }
25535 for val in &self.library_version_hash {
25536 __tmp.put_u8(*val);
25537 }
25538 if matches!(version, MavlinkVersion::V2) {
25539 let len = __tmp.len();
25540 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25541 } else {
25542 __tmp.len()
25543 }
25544 }
25545}
25546#[doc = "Status generated by radio and injected into MAVLink stream."]
25547#[doc = ""]
25548#[doc = "ID: 109"]
25549#[derive(Debug, Clone, PartialEq)]
25550#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25551#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25552#[cfg_attr(feature = "ts", derive(TS))]
25553#[cfg_attr(feature = "ts", ts(export))]
25554pub struct RADIO_STATUS_DATA {
25555 #[doc = "Count of radio packet receive errors (since boot)."]
25556 pub rxerrors: u16,
25557 #[doc = "Count of error corrected radio packets (since boot)."]
25558 pub fixed: u16,
25559 #[doc = "Local (message sender) received signal strength indication in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
25560 pub rssi: u8,
25561 #[doc = "Remote (message receiver) signal strength indication in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
25562 pub remrssi: u8,
25563 #[doc = "Remaining free transmitter buffer space."]
25564 pub txbuf: u8,
25565 #[doc = "Local background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], UINT8_MAX: invalid/unknown."]
25566 pub noise: u8,
25567 #[doc = "Remote background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], UINT8_MAX: invalid/unknown."]
25568 pub remnoise: u8,
25569}
25570impl RADIO_STATUS_DATA {
25571 pub const ENCODED_LEN: usize = 9usize;
25572 pub const DEFAULT: Self = Self {
25573 rxerrors: 0_u16,
25574 fixed: 0_u16,
25575 rssi: 0_u8,
25576 remrssi: 0_u8,
25577 txbuf: 0_u8,
25578 noise: 0_u8,
25579 remnoise: 0_u8,
25580 };
25581 #[cfg(feature = "arbitrary")]
25582 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25583 use arbitrary::{Arbitrary, Unstructured};
25584 let mut buf = [0u8; 1024];
25585 rng.fill_bytes(&mut buf);
25586 let mut unstructured = Unstructured::new(&buf);
25587 Self::arbitrary(&mut unstructured).unwrap_or_default()
25588 }
25589}
25590impl Default for RADIO_STATUS_DATA {
25591 fn default() -> Self {
25592 Self::DEFAULT.clone()
25593 }
25594}
25595impl MessageData for RADIO_STATUS_DATA {
25596 type Message = MavMessage;
25597 const ID: u32 = 109u32;
25598 const NAME: &'static str = "RADIO_STATUS";
25599 const EXTRA_CRC: u8 = 185u8;
25600 const ENCODED_LEN: usize = 9usize;
25601 fn deser(
25602 _version: MavlinkVersion,
25603 __input: &[u8],
25604 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25605 let avail_len = __input.len();
25606 let mut payload_buf = [0; Self::ENCODED_LEN];
25607 let mut buf = if avail_len < Self::ENCODED_LEN {
25608 payload_buf[0..avail_len].copy_from_slice(__input);
25609 Bytes::new(&payload_buf)
25610 } else {
25611 Bytes::new(__input)
25612 };
25613 let mut __struct = Self::default();
25614 __struct.rxerrors = buf.get_u16_le();
25615 __struct.fixed = buf.get_u16_le();
25616 __struct.rssi = buf.get_u8();
25617 __struct.remrssi = buf.get_u8();
25618 __struct.txbuf = buf.get_u8();
25619 __struct.noise = buf.get_u8();
25620 __struct.remnoise = buf.get_u8();
25621 Ok(__struct)
25622 }
25623 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25624 let mut __tmp = BytesMut::new(bytes);
25625 #[allow(clippy::absurd_extreme_comparisons)]
25626 #[allow(unused_comparisons)]
25627 if __tmp.remaining() < Self::ENCODED_LEN {
25628 panic!(
25629 "buffer is too small (need {} bytes, but got {})",
25630 Self::ENCODED_LEN,
25631 __tmp.remaining(),
25632 )
25633 }
25634 __tmp.put_u16_le(self.rxerrors);
25635 __tmp.put_u16_le(self.fixed);
25636 __tmp.put_u8(self.rssi);
25637 __tmp.put_u8(self.remrssi);
25638 __tmp.put_u8(self.txbuf);
25639 __tmp.put_u8(self.noise);
25640 __tmp.put_u8(self.remnoise);
25641 if matches!(version, MavlinkVersion::V2) {
25642 let len = __tmp.len();
25643 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25644 } else {
25645 __tmp.len()
25646 }
25647 }
25648}
25649#[doc = "The RAW IMU readings for a 9DOF sensor, which is identified by the id (default IMU1). This message should always contain the true raw values without any scaling to allow data capture and system debugging."]
25650#[doc = ""]
25651#[doc = "ID: 27"]
25652#[derive(Debug, Clone, PartialEq)]
25653#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25654#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25655#[cfg_attr(feature = "ts", derive(TS))]
25656#[cfg_attr(feature = "ts", ts(export))]
25657pub struct RAW_IMU_DATA {
25658 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
25659 pub time_usec: u64,
25660 #[doc = "X acceleration (raw)"]
25661 pub xacc: i16,
25662 #[doc = "Y acceleration (raw)"]
25663 pub yacc: i16,
25664 #[doc = "Z acceleration (raw)"]
25665 pub zacc: i16,
25666 #[doc = "Angular speed around X axis (raw)"]
25667 pub xgyro: i16,
25668 #[doc = "Angular speed around Y axis (raw)"]
25669 pub ygyro: i16,
25670 #[doc = "Angular speed around Z axis (raw)"]
25671 pub zgyro: i16,
25672 #[doc = "X Magnetic field (raw)"]
25673 pub xmag: i16,
25674 #[doc = "Y Magnetic field (raw)"]
25675 pub ymag: i16,
25676 #[doc = "Z Magnetic field (raw)"]
25677 pub zmag: i16,
25678 #[doc = "Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0)"]
25679 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25680 pub id: u8,
25681 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
25682 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25683 pub temperature: i16,
25684}
25685impl RAW_IMU_DATA {
25686 pub const ENCODED_LEN: usize = 29usize;
25687 pub const DEFAULT: Self = Self {
25688 time_usec: 0_u64,
25689 xacc: 0_i16,
25690 yacc: 0_i16,
25691 zacc: 0_i16,
25692 xgyro: 0_i16,
25693 ygyro: 0_i16,
25694 zgyro: 0_i16,
25695 xmag: 0_i16,
25696 ymag: 0_i16,
25697 zmag: 0_i16,
25698 id: 0_u8,
25699 temperature: 0_i16,
25700 };
25701 #[cfg(feature = "arbitrary")]
25702 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25703 use arbitrary::{Arbitrary, Unstructured};
25704 let mut buf = [0u8; 1024];
25705 rng.fill_bytes(&mut buf);
25706 let mut unstructured = Unstructured::new(&buf);
25707 Self::arbitrary(&mut unstructured).unwrap_or_default()
25708 }
25709}
25710impl Default for RAW_IMU_DATA {
25711 fn default() -> Self {
25712 Self::DEFAULT.clone()
25713 }
25714}
25715impl MessageData for RAW_IMU_DATA {
25716 type Message = MavMessage;
25717 const ID: u32 = 27u32;
25718 const NAME: &'static str = "RAW_IMU";
25719 const EXTRA_CRC: u8 = 144u8;
25720 const ENCODED_LEN: usize = 29usize;
25721 fn deser(
25722 _version: MavlinkVersion,
25723 __input: &[u8],
25724 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25725 let avail_len = __input.len();
25726 let mut payload_buf = [0; Self::ENCODED_LEN];
25727 let mut buf = if avail_len < Self::ENCODED_LEN {
25728 payload_buf[0..avail_len].copy_from_slice(__input);
25729 Bytes::new(&payload_buf)
25730 } else {
25731 Bytes::new(__input)
25732 };
25733 let mut __struct = Self::default();
25734 __struct.time_usec = buf.get_u64_le();
25735 __struct.xacc = buf.get_i16_le();
25736 __struct.yacc = buf.get_i16_le();
25737 __struct.zacc = buf.get_i16_le();
25738 __struct.xgyro = buf.get_i16_le();
25739 __struct.ygyro = buf.get_i16_le();
25740 __struct.zgyro = buf.get_i16_le();
25741 __struct.xmag = buf.get_i16_le();
25742 __struct.ymag = buf.get_i16_le();
25743 __struct.zmag = buf.get_i16_le();
25744 __struct.id = buf.get_u8();
25745 __struct.temperature = buf.get_i16_le();
25746 Ok(__struct)
25747 }
25748 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25749 let mut __tmp = BytesMut::new(bytes);
25750 #[allow(clippy::absurd_extreme_comparisons)]
25751 #[allow(unused_comparisons)]
25752 if __tmp.remaining() < Self::ENCODED_LEN {
25753 panic!(
25754 "buffer is too small (need {} bytes, but got {})",
25755 Self::ENCODED_LEN,
25756 __tmp.remaining(),
25757 )
25758 }
25759 __tmp.put_u64_le(self.time_usec);
25760 __tmp.put_i16_le(self.xacc);
25761 __tmp.put_i16_le(self.yacc);
25762 __tmp.put_i16_le(self.zacc);
25763 __tmp.put_i16_le(self.xgyro);
25764 __tmp.put_i16_le(self.ygyro);
25765 __tmp.put_i16_le(self.zgyro);
25766 __tmp.put_i16_le(self.xmag);
25767 __tmp.put_i16_le(self.ymag);
25768 __tmp.put_i16_le(self.zmag);
25769 if matches!(version, MavlinkVersion::V2) {
25770 __tmp.put_u8(self.id);
25771 __tmp.put_i16_le(self.temperature);
25772 let len = __tmp.len();
25773 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25774 } else {
25775 __tmp.len()
25776 }
25777 }
25778}
25779#[doc = "The RAW pressure readings for the typical setup of one absolute pressure and one differential pressure sensor. The sensor values should be the raw, UNSCALED ADC values."]
25780#[doc = ""]
25781#[doc = "ID: 28"]
25782#[derive(Debug, Clone, PartialEq)]
25783#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25784#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25785#[cfg_attr(feature = "ts", derive(TS))]
25786#[cfg_attr(feature = "ts", ts(export))]
25787pub struct RAW_PRESSURE_DATA {
25788 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
25789 pub time_usec: u64,
25790 #[doc = "Absolute pressure (raw)"]
25791 pub press_abs: i16,
25792 #[doc = "Differential pressure 1 (raw, 0 if nonexistent)"]
25793 pub press_diff1: i16,
25794 #[doc = "Differential pressure 2 (raw, 0 if nonexistent)"]
25795 pub press_diff2: i16,
25796 #[doc = "Raw Temperature measurement (raw)"]
25797 pub temperature: i16,
25798}
25799impl RAW_PRESSURE_DATA {
25800 pub const ENCODED_LEN: usize = 16usize;
25801 pub const DEFAULT: Self = Self {
25802 time_usec: 0_u64,
25803 press_abs: 0_i16,
25804 press_diff1: 0_i16,
25805 press_diff2: 0_i16,
25806 temperature: 0_i16,
25807 };
25808 #[cfg(feature = "arbitrary")]
25809 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25810 use arbitrary::{Arbitrary, Unstructured};
25811 let mut buf = [0u8; 1024];
25812 rng.fill_bytes(&mut buf);
25813 let mut unstructured = Unstructured::new(&buf);
25814 Self::arbitrary(&mut unstructured).unwrap_or_default()
25815 }
25816}
25817impl Default for RAW_PRESSURE_DATA {
25818 fn default() -> Self {
25819 Self::DEFAULT.clone()
25820 }
25821}
25822impl MessageData for RAW_PRESSURE_DATA {
25823 type Message = MavMessage;
25824 const ID: u32 = 28u32;
25825 const NAME: &'static str = "RAW_PRESSURE";
25826 const EXTRA_CRC: u8 = 67u8;
25827 const ENCODED_LEN: usize = 16usize;
25828 fn deser(
25829 _version: MavlinkVersion,
25830 __input: &[u8],
25831 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25832 let avail_len = __input.len();
25833 let mut payload_buf = [0; Self::ENCODED_LEN];
25834 let mut buf = if avail_len < Self::ENCODED_LEN {
25835 payload_buf[0..avail_len].copy_from_slice(__input);
25836 Bytes::new(&payload_buf)
25837 } else {
25838 Bytes::new(__input)
25839 };
25840 let mut __struct = Self::default();
25841 __struct.time_usec = buf.get_u64_le();
25842 __struct.press_abs = buf.get_i16_le();
25843 __struct.press_diff1 = buf.get_i16_le();
25844 __struct.press_diff2 = buf.get_i16_le();
25845 __struct.temperature = buf.get_i16_le();
25846 Ok(__struct)
25847 }
25848 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25849 let mut __tmp = BytesMut::new(bytes);
25850 #[allow(clippy::absurd_extreme_comparisons)]
25851 #[allow(unused_comparisons)]
25852 if __tmp.remaining() < Self::ENCODED_LEN {
25853 panic!(
25854 "buffer is too small (need {} bytes, but got {})",
25855 Self::ENCODED_LEN,
25856 __tmp.remaining(),
25857 )
25858 }
25859 __tmp.put_u64_le(self.time_usec);
25860 __tmp.put_i16_le(self.press_abs);
25861 __tmp.put_i16_le(self.press_diff1);
25862 __tmp.put_i16_le(self.press_diff2);
25863 __tmp.put_i16_le(self.temperature);
25864 if matches!(version, MavlinkVersion::V2) {
25865 let len = __tmp.len();
25866 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25867 } else {
25868 __tmp.len()
25869 }
25870 }
25871}
25872#[doc = "RPM sensor data message."]
25873#[doc = ""]
25874#[doc = "ID: 339"]
25875#[derive(Debug, Clone, PartialEq)]
25876#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25877#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25878#[cfg_attr(feature = "ts", derive(TS))]
25879#[cfg_attr(feature = "ts", ts(export))]
25880pub struct RAW_RPM_DATA {
25881 #[doc = "Indicated rate"]
25882 pub frequency: f32,
25883 #[doc = "Index of this RPM sensor (0-indexed)"]
25884 pub index: u8,
25885}
25886impl RAW_RPM_DATA {
25887 pub const ENCODED_LEN: usize = 5usize;
25888 pub const DEFAULT: Self = Self {
25889 frequency: 0.0_f32,
25890 index: 0_u8,
25891 };
25892 #[cfg(feature = "arbitrary")]
25893 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25894 use arbitrary::{Arbitrary, Unstructured};
25895 let mut buf = [0u8; 1024];
25896 rng.fill_bytes(&mut buf);
25897 let mut unstructured = Unstructured::new(&buf);
25898 Self::arbitrary(&mut unstructured).unwrap_or_default()
25899 }
25900}
25901impl Default for RAW_RPM_DATA {
25902 fn default() -> Self {
25903 Self::DEFAULT.clone()
25904 }
25905}
25906impl MessageData for RAW_RPM_DATA {
25907 type Message = MavMessage;
25908 const ID: u32 = 339u32;
25909 const NAME: &'static str = "RAW_RPM";
25910 const EXTRA_CRC: u8 = 199u8;
25911 const ENCODED_LEN: usize = 5usize;
25912 fn deser(
25913 _version: MavlinkVersion,
25914 __input: &[u8],
25915 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25916 let avail_len = __input.len();
25917 let mut payload_buf = [0; Self::ENCODED_LEN];
25918 let mut buf = if avail_len < Self::ENCODED_LEN {
25919 payload_buf[0..avail_len].copy_from_slice(__input);
25920 Bytes::new(&payload_buf)
25921 } else {
25922 Bytes::new(__input)
25923 };
25924 let mut __struct = Self::default();
25925 __struct.frequency = buf.get_f32_le();
25926 __struct.index = buf.get_u8();
25927 Ok(__struct)
25928 }
25929 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25930 let mut __tmp = BytesMut::new(bytes);
25931 #[allow(clippy::absurd_extreme_comparisons)]
25932 #[allow(unused_comparisons)]
25933 if __tmp.remaining() < Self::ENCODED_LEN {
25934 panic!(
25935 "buffer is too small (need {} bytes, but got {})",
25936 Self::ENCODED_LEN,
25937 __tmp.remaining(),
25938 )
25939 }
25940 __tmp.put_f32_le(self.frequency);
25941 __tmp.put_u8(self.index);
25942 if matches!(version, MavlinkVersion::V2) {
25943 let len = __tmp.len();
25944 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25945 } else {
25946 __tmp.len()
25947 }
25948 }
25949}
25950#[doc = "The PPM values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
25951#[doc = ""]
25952#[doc = "ID: 65"]
25953#[derive(Debug, Clone, PartialEq)]
25954#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25955#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25956#[cfg_attr(feature = "ts", derive(TS))]
25957#[cfg_attr(feature = "ts", ts(export))]
25958pub struct RC_CHANNELS_DATA {
25959 #[doc = "Timestamp (time since system boot)."]
25960 pub time_boot_ms: u32,
25961 #[doc = "RC channel 1 value."]
25962 pub chan1_raw: u16,
25963 #[doc = "RC channel 2 value."]
25964 pub chan2_raw: u16,
25965 #[doc = "RC channel 3 value."]
25966 pub chan3_raw: u16,
25967 #[doc = "RC channel 4 value."]
25968 pub chan4_raw: u16,
25969 #[doc = "RC channel 5 value."]
25970 pub chan5_raw: u16,
25971 #[doc = "RC channel 6 value."]
25972 pub chan6_raw: u16,
25973 #[doc = "RC channel 7 value."]
25974 pub chan7_raw: u16,
25975 #[doc = "RC channel 8 value."]
25976 pub chan8_raw: u16,
25977 #[doc = "RC channel 9 value."]
25978 pub chan9_raw: u16,
25979 #[doc = "RC channel 10 value."]
25980 pub chan10_raw: u16,
25981 #[doc = "RC channel 11 value."]
25982 pub chan11_raw: u16,
25983 #[doc = "RC channel 12 value."]
25984 pub chan12_raw: u16,
25985 #[doc = "RC channel 13 value."]
25986 pub chan13_raw: u16,
25987 #[doc = "RC channel 14 value."]
25988 pub chan14_raw: u16,
25989 #[doc = "RC channel 15 value."]
25990 pub chan15_raw: u16,
25991 #[doc = "RC channel 16 value."]
25992 pub chan16_raw: u16,
25993 #[doc = "RC channel 17 value."]
25994 pub chan17_raw: u16,
25995 #[doc = "RC channel 18 value."]
25996 pub chan18_raw: u16,
25997 #[doc = "Total number of RC channels being received. This can be larger than 18, indicating that more channels are available but not given in this message. This value should be 0 when no RC channels are available."]
25998 pub chancount: u8,
25999 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
26000 pub rssi: u8,
26001}
26002impl RC_CHANNELS_DATA {
26003 pub const ENCODED_LEN: usize = 42usize;
26004 pub const DEFAULT: Self = Self {
26005 time_boot_ms: 0_u32,
26006 chan1_raw: 0_u16,
26007 chan2_raw: 0_u16,
26008 chan3_raw: 0_u16,
26009 chan4_raw: 0_u16,
26010 chan5_raw: 0_u16,
26011 chan6_raw: 0_u16,
26012 chan7_raw: 0_u16,
26013 chan8_raw: 0_u16,
26014 chan9_raw: 0_u16,
26015 chan10_raw: 0_u16,
26016 chan11_raw: 0_u16,
26017 chan12_raw: 0_u16,
26018 chan13_raw: 0_u16,
26019 chan14_raw: 0_u16,
26020 chan15_raw: 0_u16,
26021 chan16_raw: 0_u16,
26022 chan17_raw: 0_u16,
26023 chan18_raw: 0_u16,
26024 chancount: 0_u8,
26025 rssi: 0_u8,
26026 };
26027 #[cfg(feature = "arbitrary")]
26028 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26029 use arbitrary::{Arbitrary, Unstructured};
26030 let mut buf = [0u8; 1024];
26031 rng.fill_bytes(&mut buf);
26032 let mut unstructured = Unstructured::new(&buf);
26033 Self::arbitrary(&mut unstructured).unwrap_or_default()
26034 }
26035}
26036impl Default for RC_CHANNELS_DATA {
26037 fn default() -> Self {
26038 Self::DEFAULT.clone()
26039 }
26040}
26041impl MessageData for RC_CHANNELS_DATA {
26042 type Message = MavMessage;
26043 const ID: u32 = 65u32;
26044 const NAME: &'static str = "RC_CHANNELS";
26045 const EXTRA_CRC: u8 = 118u8;
26046 const ENCODED_LEN: usize = 42usize;
26047 fn deser(
26048 _version: MavlinkVersion,
26049 __input: &[u8],
26050 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26051 let avail_len = __input.len();
26052 let mut payload_buf = [0; Self::ENCODED_LEN];
26053 let mut buf = if avail_len < Self::ENCODED_LEN {
26054 payload_buf[0..avail_len].copy_from_slice(__input);
26055 Bytes::new(&payload_buf)
26056 } else {
26057 Bytes::new(__input)
26058 };
26059 let mut __struct = Self::default();
26060 __struct.time_boot_ms = buf.get_u32_le();
26061 __struct.chan1_raw = buf.get_u16_le();
26062 __struct.chan2_raw = buf.get_u16_le();
26063 __struct.chan3_raw = buf.get_u16_le();
26064 __struct.chan4_raw = buf.get_u16_le();
26065 __struct.chan5_raw = buf.get_u16_le();
26066 __struct.chan6_raw = buf.get_u16_le();
26067 __struct.chan7_raw = buf.get_u16_le();
26068 __struct.chan8_raw = buf.get_u16_le();
26069 __struct.chan9_raw = buf.get_u16_le();
26070 __struct.chan10_raw = buf.get_u16_le();
26071 __struct.chan11_raw = buf.get_u16_le();
26072 __struct.chan12_raw = buf.get_u16_le();
26073 __struct.chan13_raw = buf.get_u16_le();
26074 __struct.chan14_raw = buf.get_u16_le();
26075 __struct.chan15_raw = buf.get_u16_le();
26076 __struct.chan16_raw = buf.get_u16_le();
26077 __struct.chan17_raw = buf.get_u16_le();
26078 __struct.chan18_raw = buf.get_u16_le();
26079 __struct.chancount = buf.get_u8();
26080 __struct.rssi = buf.get_u8();
26081 Ok(__struct)
26082 }
26083 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26084 let mut __tmp = BytesMut::new(bytes);
26085 #[allow(clippy::absurd_extreme_comparisons)]
26086 #[allow(unused_comparisons)]
26087 if __tmp.remaining() < Self::ENCODED_LEN {
26088 panic!(
26089 "buffer is too small (need {} bytes, but got {})",
26090 Self::ENCODED_LEN,
26091 __tmp.remaining(),
26092 )
26093 }
26094 __tmp.put_u32_le(self.time_boot_ms);
26095 __tmp.put_u16_le(self.chan1_raw);
26096 __tmp.put_u16_le(self.chan2_raw);
26097 __tmp.put_u16_le(self.chan3_raw);
26098 __tmp.put_u16_le(self.chan4_raw);
26099 __tmp.put_u16_le(self.chan5_raw);
26100 __tmp.put_u16_le(self.chan6_raw);
26101 __tmp.put_u16_le(self.chan7_raw);
26102 __tmp.put_u16_le(self.chan8_raw);
26103 __tmp.put_u16_le(self.chan9_raw);
26104 __tmp.put_u16_le(self.chan10_raw);
26105 __tmp.put_u16_le(self.chan11_raw);
26106 __tmp.put_u16_le(self.chan12_raw);
26107 __tmp.put_u16_le(self.chan13_raw);
26108 __tmp.put_u16_le(self.chan14_raw);
26109 __tmp.put_u16_le(self.chan15_raw);
26110 __tmp.put_u16_le(self.chan16_raw);
26111 __tmp.put_u16_le(self.chan17_raw);
26112 __tmp.put_u16_le(self.chan18_raw);
26113 __tmp.put_u8(self.chancount);
26114 __tmp.put_u8(self.rssi);
26115 if matches!(version, MavlinkVersion::V2) {
26116 let len = __tmp.len();
26117 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26118 } else {
26119 __tmp.len()
26120 }
26121 }
26122}
26123#[doc = "The RAW values of the RC channels sent to the MAV to override info received from the RC radio. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. Note carefully the semantic differences between the first 8 channels and the subsequent channels."]
26124#[doc = ""]
26125#[doc = "ID: 70"]
26126#[derive(Debug, Clone, PartialEq)]
26127#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26128#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26129#[cfg_attr(feature = "ts", derive(TS))]
26130#[cfg_attr(feature = "ts", ts(export))]
26131pub struct RC_CHANNELS_OVERRIDE_DATA {
26132 #[doc = "RC channel 1 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
26133 pub chan1_raw: u16,
26134 #[doc = "RC channel 2 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
26135 pub chan2_raw: u16,
26136 #[doc = "RC channel 3 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
26137 pub chan3_raw: u16,
26138 #[doc = "RC channel 4 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
26139 pub chan4_raw: u16,
26140 #[doc = "RC channel 5 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
26141 pub chan5_raw: u16,
26142 #[doc = "RC channel 6 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
26143 pub chan6_raw: u16,
26144 #[doc = "RC channel 7 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
26145 pub chan7_raw: u16,
26146 #[doc = "RC channel 8 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
26147 pub chan8_raw: u16,
26148 #[doc = "System ID"]
26149 pub target_system: u8,
26150 #[doc = "Component ID"]
26151 pub target_component: u8,
26152 #[doc = "RC channel 9 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
26153 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26154 pub chan9_raw: u16,
26155 #[doc = "RC channel 10 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
26156 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26157 pub chan10_raw: u16,
26158 #[doc = "RC channel 11 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
26159 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26160 pub chan11_raw: u16,
26161 #[doc = "RC channel 12 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
26162 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26163 pub chan12_raw: u16,
26164 #[doc = "RC channel 13 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
26165 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26166 pub chan13_raw: u16,
26167 #[doc = "RC channel 14 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
26168 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26169 pub chan14_raw: u16,
26170 #[doc = "RC channel 15 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
26171 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26172 pub chan15_raw: u16,
26173 #[doc = "RC channel 16 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
26174 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26175 pub chan16_raw: u16,
26176 #[doc = "RC channel 17 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
26177 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26178 pub chan17_raw: u16,
26179 #[doc = "RC channel 18 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
26180 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26181 pub chan18_raw: u16,
26182}
26183impl RC_CHANNELS_OVERRIDE_DATA {
26184 pub const ENCODED_LEN: usize = 38usize;
26185 pub const DEFAULT: Self = Self {
26186 chan1_raw: 0_u16,
26187 chan2_raw: 0_u16,
26188 chan3_raw: 0_u16,
26189 chan4_raw: 0_u16,
26190 chan5_raw: 0_u16,
26191 chan6_raw: 0_u16,
26192 chan7_raw: 0_u16,
26193 chan8_raw: 0_u16,
26194 target_system: 0_u8,
26195 target_component: 0_u8,
26196 chan9_raw: 0_u16,
26197 chan10_raw: 0_u16,
26198 chan11_raw: 0_u16,
26199 chan12_raw: 0_u16,
26200 chan13_raw: 0_u16,
26201 chan14_raw: 0_u16,
26202 chan15_raw: 0_u16,
26203 chan16_raw: 0_u16,
26204 chan17_raw: 0_u16,
26205 chan18_raw: 0_u16,
26206 };
26207 #[cfg(feature = "arbitrary")]
26208 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26209 use arbitrary::{Arbitrary, Unstructured};
26210 let mut buf = [0u8; 1024];
26211 rng.fill_bytes(&mut buf);
26212 let mut unstructured = Unstructured::new(&buf);
26213 Self::arbitrary(&mut unstructured).unwrap_or_default()
26214 }
26215}
26216impl Default for RC_CHANNELS_OVERRIDE_DATA {
26217 fn default() -> Self {
26218 Self::DEFAULT.clone()
26219 }
26220}
26221impl MessageData for RC_CHANNELS_OVERRIDE_DATA {
26222 type Message = MavMessage;
26223 const ID: u32 = 70u32;
26224 const NAME: &'static str = "RC_CHANNELS_OVERRIDE";
26225 const EXTRA_CRC: u8 = 124u8;
26226 const ENCODED_LEN: usize = 38usize;
26227 fn deser(
26228 _version: MavlinkVersion,
26229 __input: &[u8],
26230 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26231 let avail_len = __input.len();
26232 let mut payload_buf = [0; Self::ENCODED_LEN];
26233 let mut buf = if avail_len < Self::ENCODED_LEN {
26234 payload_buf[0..avail_len].copy_from_slice(__input);
26235 Bytes::new(&payload_buf)
26236 } else {
26237 Bytes::new(__input)
26238 };
26239 let mut __struct = Self::default();
26240 __struct.chan1_raw = buf.get_u16_le();
26241 __struct.chan2_raw = buf.get_u16_le();
26242 __struct.chan3_raw = buf.get_u16_le();
26243 __struct.chan4_raw = buf.get_u16_le();
26244 __struct.chan5_raw = buf.get_u16_le();
26245 __struct.chan6_raw = buf.get_u16_le();
26246 __struct.chan7_raw = buf.get_u16_le();
26247 __struct.chan8_raw = buf.get_u16_le();
26248 __struct.target_system = buf.get_u8();
26249 __struct.target_component = buf.get_u8();
26250 __struct.chan9_raw = buf.get_u16_le();
26251 __struct.chan10_raw = buf.get_u16_le();
26252 __struct.chan11_raw = buf.get_u16_le();
26253 __struct.chan12_raw = buf.get_u16_le();
26254 __struct.chan13_raw = buf.get_u16_le();
26255 __struct.chan14_raw = buf.get_u16_le();
26256 __struct.chan15_raw = buf.get_u16_le();
26257 __struct.chan16_raw = buf.get_u16_le();
26258 __struct.chan17_raw = buf.get_u16_le();
26259 __struct.chan18_raw = buf.get_u16_le();
26260 Ok(__struct)
26261 }
26262 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26263 let mut __tmp = BytesMut::new(bytes);
26264 #[allow(clippy::absurd_extreme_comparisons)]
26265 #[allow(unused_comparisons)]
26266 if __tmp.remaining() < Self::ENCODED_LEN {
26267 panic!(
26268 "buffer is too small (need {} bytes, but got {})",
26269 Self::ENCODED_LEN,
26270 __tmp.remaining(),
26271 )
26272 }
26273 __tmp.put_u16_le(self.chan1_raw);
26274 __tmp.put_u16_le(self.chan2_raw);
26275 __tmp.put_u16_le(self.chan3_raw);
26276 __tmp.put_u16_le(self.chan4_raw);
26277 __tmp.put_u16_le(self.chan5_raw);
26278 __tmp.put_u16_le(self.chan6_raw);
26279 __tmp.put_u16_le(self.chan7_raw);
26280 __tmp.put_u16_le(self.chan8_raw);
26281 __tmp.put_u8(self.target_system);
26282 __tmp.put_u8(self.target_component);
26283 if matches!(version, MavlinkVersion::V2) {
26284 __tmp.put_u16_le(self.chan9_raw);
26285 __tmp.put_u16_le(self.chan10_raw);
26286 __tmp.put_u16_le(self.chan11_raw);
26287 __tmp.put_u16_le(self.chan12_raw);
26288 __tmp.put_u16_le(self.chan13_raw);
26289 __tmp.put_u16_le(self.chan14_raw);
26290 __tmp.put_u16_le(self.chan15_raw);
26291 __tmp.put_u16_le(self.chan16_raw);
26292 __tmp.put_u16_le(self.chan17_raw);
26293 __tmp.put_u16_le(self.chan18_raw);
26294 let len = __tmp.len();
26295 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26296 } else {
26297 __tmp.len()
26298 }
26299 }
26300}
26301#[doc = "The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
26302#[doc = ""]
26303#[doc = "ID: 35"]
26304#[derive(Debug, Clone, PartialEq)]
26305#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26306#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26307#[cfg_attr(feature = "ts", derive(TS))]
26308#[cfg_attr(feature = "ts", ts(export))]
26309pub struct RC_CHANNELS_RAW_DATA {
26310 #[doc = "Timestamp (time since system boot)."]
26311 pub time_boot_ms: u32,
26312 #[doc = "RC channel 1 value."]
26313 pub chan1_raw: u16,
26314 #[doc = "RC channel 2 value."]
26315 pub chan2_raw: u16,
26316 #[doc = "RC channel 3 value."]
26317 pub chan3_raw: u16,
26318 #[doc = "RC channel 4 value."]
26319 pub chan4_raw: u16,
26320 #[doc = "RC channel 5 value."]
26321 pub chan5_raw: u16,
26322 #[doc = "RC channel 6 value."]
26323 pub chan6_raw: u16,
26324 #[doc = "RC channel 7 value."]
26325 pub chan7_raw: u16,
26326 #[doc = "RC channel 8 value."]
26327 pub chan8_raw: u16,
26328 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
26329 pub port: u8,
26330 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
26331 pub rssi: u8,
26332}
26333impl RC_CHANNELS_RAW_DATA {
26334 pub const ENCODED_LEN: usize = 22usize;
26335 pub const DEFAULT: Self = Self {
26336 time_boot_ms: 0_u32,
26337 chan1_raw: 0_u16,
26338 chan2_raw: 0_u16,
26339 chan3_raw: 0_u16,
26340 chan4_raw: 0_u16,
26341 chan5_raw: 0_u16,
26342 chan6_raw: 0_u16,
26343 chan7_raw: 0_u16,
26344 chan8_raw: 0_u16,
26345 port: 0_u8,
26346 rssi: 0_u8,
26347 };
26348 #[cfg(feature = "arbitrary")]
26349 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26350 use arbitrary::{Arbitrary, Unstructured};
26351 let mut buf = [0u8; 1024];
26352 rng.fill_bytes(&mut buf);
26353 let mut unstructured = Unstructured::new(&buf);
26354 Self::arbitrary(&mut unstructured).unwrap_or_default()
26355 }
26356}
26357impl Default for RC_CHANNELS_RAW_DATA {
26358 fn default() -> Self {
26359 Self::DEFAULT.clone()
26360 }
26361}
26362impl MessageData for RC_CHANNELS_RAW_DATA {
26363 type Message = MavMessage;
26364 const ID: u32 = 35u32;
26365 const NAME: &'static str = "RC_CHANNELS_RAW";
26366 const EXTRA_CRC: u8 = 244u8;
26367 const ENCODED_LEN: usize = 22usize;
26368 fn deser(
26369 _version: MavlinkVersion,
26370 __input: &[u8],
26371 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26372 let avail_len = __input.len();
26373 let mut payload_buf = [0; Self::ENCODED_LEN];
26374 let mut buf = if avail_len < Self::ENCODED_LEN {
26375 payload_buf[0..avail_len].copy_from_slice(__input);
26376 Bytes::new(&payload_buf)
26377 } else {
26378 Bytes::new(__input)
26379 };
26380 let mut __struct = Self::default();
26381 __struct.time_boot_ms = buf.get_u32_le();
26382 __struct.chan1_raw = buf.get_u16_le();
26383 __struct.chan2_raw = buf.get_u16_le();
26384 __struct.chan3_raw = buf.get_u16_le();
26385 __struct.chan4_raw = buf.get_u16_le();
26386 __struct.chan5_raw = buf.get_u16_le();
26387 __struct.chan6_raw = buf.get_u16_le();
26388 __struct.chan7_raw = buf.get_u16_le();
26389 __struct.chan8_raw = buf.get_u16_le();
26390 __struct.port = buf.get_u8();
26391 __struct.rssi = buf.get_u8();
26392 Ok(__struct)
26393 }
26394 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26395 let mut __tmp = BytesMut::new(bytes);
26396 #[allow(clippy::absurd_extreme_comparisons)]
26397 #[allow(unused_comparisons)]
26398 if __tmp.remaining() < Self::ENCODED_LEN {
26399 panic!(
26400 "buffer is too small (need {} bytes, but got {})",
26401 Self::ENCODED_LEN,
26402 __tmp.remaining(),
26403 )
26404 }
26405 __tmp.put_u32_le(self.time_boot_ms);
26406 __tmp.put_u16_le(self.chan1_raw);
26407 __tmp.put_u16_le(self.chan2_raw);
26408 __tmp.put_u16_le(self.chan3_raw);
26409 __tmp.put_u16_le(self.chan4_raw);
26410 __tmp.put_u16_le(self.chan5_raw);
26411 __tmp.put_u16_le(self.chan6_raw);
26412 __tmp.put_u16_le(self.chan7_raw);
26413 __tmp.put_u16_le(self.chan8_raw);
26414 __tmp.put_u8(self.port);
26415 __tmp.put_u8(self.rssi);
26416 if matches!(version, MavlinkVersion::V2) {
26417 let len = __tmp.len();
26418 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26419 } else {
26420 __tmp.len()
26421 }
26422 }
26423}
26424#[doc = "The scaled values of the RC channels received: (-100%) -10000, (0%) 0, (100%) 10000. Channels that are inactive should be set to INT16_MAX."]
26425#[doc = ""]
26426#[doc = "ID: 34"]
26427#[derive(Debug, Clone, PartialEq)]
26428#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26429#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26430#[cfg_attr(feature = "ts", derive(TS))]
26431#[cfg_attr(feature = "ts", ts(export))]
26432pub struct RC_CHANNELS_SCALED_DATA {
26433 #[doc = "Timestamp (time since system boot)."]
26434 pub time_boot_ms: u32,
26435 #[doc = "RC channel 1 value scaled."]
26436 pub chan1_scaled: i16,
26437 #[doc = "RC channel 2 value scaled."]
26438 pub chan2_scaled: i16,
26439 #[doc = "RC channel 3 value scaled."]
26440 pub chan3_scaled: i16,
26441 #[doc = "RC channel 4 value scaled."]
26442 pub chan4_scaled: i16,
26443 #[doc = "RC channel 5 value scaled."]
26444 pub chan5_scaled: i16,
26445 #[doc = "RC channel 6 value scaled."]
26446 pub chan6_scaled: i16,
26447 #[doc = "RC channel 7 value scaled."]
26448 pub chan7_scaled: i16,
26449 #[doc = "RC channel 8 value scaled."]
26450 pub chan8_scaled: i16,
26451 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
26452 pub port: u8,
26453 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
26454 pub rssi: u8,
26455}
26456impl RC_CHANNELS_SCALED_DATA {
26457 pub const ENCODED_LEN: usize = 22usize;
26458 pub const DEFAULT: Self = Self {
26459 time_boot_ms: 0_u32,
26460 chan1_scaled: 0_i16,
26461 chan2_scaled: 0_i16,
26462 chan3_scaled: 0_i16,
26463 chan4_scaled: 0_i16,
26464 chan5_scaled: 0_i16,
26465 chan6_scaled: 0_i16,
26466 chan7_scaled: 0_i16,
26467 chan8_scaled: 0_i16,
26468 port: 0_u8,
26469 rssi: 0_u8,
26470 };
26471 #[cfg(feature = "arbitrary")]
26472 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26473 use arbitrary::{Arbitrary, Unstructured};
26474 let mut buf = [0u8; 1024];
26475 rng.fill_bytes(&mut buf);
26476 let mut unstructured = Unstructured::new(&buf);
26477 Self::arbitrary(&mut unstructured).unwrap_or_default()
26478 }
26479}
26480impl Default for RC_CHANNELS_SCALED_DATA {
26481 fn default() -> Self {
26482 Self::DEFAULT.clone()
26483 }
26484}
26485impl MessageData for RC_CHANNELS_SCALED_DATA {
26486 type Message = MavMessage;
26487 const ID: u32 = 34u32;
26488 const NAME: &'static str = "RC_CHANNELS_SCALED";
26489 const EXTRA_CRC: u8 = 237u8;
26490 const ENCODED_LEN: usize = 22usize;
26491 fn deser(
26492 _version: MavlinkVersion,
26493 __input: &[u8],
26494 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26495 let avail_len = __input.len();
26496 let mut payload_buf = [0; Self::ENCODED_LEN];
26497 let mut buf = if avail_len < Self::ENCODED_LEN {
26498 payload_buf[0..avail_len].copy_from_slice(__input);
26499 Bytes::new(&payload_buf)
26500 } else {
26501 Bytes::new(__input)
26502 };
26503 let mut __struct = Self::default();
26504 __struct.time_boot_ms = buf.get_u32_le();
26505 __struct.chan1_scaled = buf.get_i16_le();
26506 __struct.chan2_scaled = buf.get_i16_le();
26507 __struct.chan3_scaled = buf.get_i16_le();
26508 __struct.chan4_scaled = buf.get_i16_le();
26509 __struct.chan5_scaled = buf.get_i16_le();
26510 __struct.chan6_scaled = buf.get_i16_le();
26511 __struct.chan7_scaled = buf.get_i16_le();
26512 __struct.chan8_scaled = buf.get_i16_le();
26513 __struct.port = buf.get_u8();
26514 __struct.rssi = buf.get_u8();
26515 Ok(__struct)
26516 }
26517 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26518 let mut __tmp = BytesMut::new(bytes);
26519 #[allow(clippy::absurd_extreme_comparisons)]
26520 #[allow(unused_comparisons)]
26521 if __tmp.remaining() < Self::ENCODED_LEN {
26522 panic!(
26523 "buffer is too small (need {} bytes, but got {})",
26524 Self::ENCODED_LEN,
26525 __tmp.remaining(),
26526 )
26527 }
26528 __tmp.put_u32_le(self.time_boot_ms);
26529 __tmp.put_i16_le(self.chan1_scaled);
26530 __tmp.put_i16_le(self.chan2_scaled);
26531 __tmp.put_i16_le(self.chan3_scaled);
26532 __tmp.put_i16_le(self.chan4_scaled);
26533 __tmp.put_i16_le(self.chan5_scaled);
26534 __tmp.put_i16_le(self.chan6_scaled);
26535 __tmp.put_i16_le(self.chan7_scaled);
26536 __tmp.put_i16_le(self.chan8_scaled);
26537 __tmp.put_u8(self.port);
26538 __tmp.put_u8(self.rssi);
26539 if matches!(version, MavlinkVersion::V2) {
26540 let len = __tmp.len();
26541 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26542 } else {
26543 __tmp.len()
26544 }
26545 }
26546}
26547#[deprecated = " See `MAV_CMD_SET_MESSAGE_INTERVAL ` (Deprecated since 2015-08)"]
26548#[doc = "Request a data stream."]
26549#[doc = ""]
26550#[doc = "ID: 66"]
26551#[derive(Debug, Clone, PartialEq)]
26552#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26553#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26554#[cfg_attr(feature = "ts", derive(TS))]
26555#[cfg_attr(feature = "ts", ts(export))]
26556pub struct REQUEST_DATA_STREAM_DATA {
26557 #[doc = "The requested message rate"]
26558 pub req_message_rate: u16,
26559 #[doc = "The target requested to send the message stream."]
26560 pub target_system: u8,
26561 #[doc = "The target requested to send the message stream."]
26562 pub target_component: u8,
26563 #[doc = "The ID of the requested data stream"]
26564 pub req_stream_id: u8,
26565 #[doc = "1 to start sending, 0 to stop sending."]
26566 pub start_stop: u8,
26567}
26568impl REQUEST_DATA_STREAM_DATA {
26569 pub const ENCODED_LEN: usize = 6usize;
26570 pub const DEFAULT: Self = Self {
26571 req_message_rate: 0_u16,
26572 target_system: 0_u8,
26573 target_component: 0_u8,
26574 req_stream_id: 0_u8,
26575 start_stop: 0_u8,
26576 };
26577 #[cfg(feature = "arbitrary")]
26578 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26579 use arbitrary::{Arbitrary, Unstructured};
26580 let mut buf = [0u8; 1024];
26581 rng.fill_bytes(&mut buf);
26582 let mut unstructured = Unstructured::new(&buf);
26583 Self::arbitrary(&mut unstructured).unwrap_or_default()
26584 }
26585}
26586impl Default for REQUEST_DATA_STREAM_DATA {
26587 fn default() -> Self {
26588 Self::DEFAULT.clone()
26589 }
26590}
26591impl MessageData for REQUEST_DATA_STREAM_DATA {
26592 type Message = MavMessage;
26593 const ID: u32 = 66u32;
26594 const NAME: &'static str = "REQUEST_DATA_STREAM";
26595 const EXTRA_CRC: u8 = 148u8;
26596 const ENCODED_LEN: usize = 6usize;
26597 fn deser(
26598 _version: MavlinkVersion,
26599 __input: &[u8],
26600 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26601 let avail_len = __input.len();
26602 let mut payload_buf = [0; Self::ENCODED_LEN];
26603 let mut buf = if avail_len < Self::ENCODED_LEN {
26604 payload_buf[0..avail_len].copy_from_slice(__input);
26605 Bytes::new(&payload_buf)
26606 } else {
26607 Bytes::new(__input)
26608 };
26609 let mut __struct = Self::default();
26610 __struct.req_message_rate = buf.get_u16_le();
26611 __struct.target_system = buf.get_u8();
26612 __struct.target_component = buf.get_u8();
26613 __struct.req_stream_id = buf.get_u8();
26614 __struct.start_stop = buf.get_u8();
26615 Ok(__struct)
26616 }
26617 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26618 let mut __tmp = BytesMut::new(bytes);
26619 #[allow(clippy::absurd_extreme_comparisons)]
26620 #[allow(unused_comparisons)]
26621 if __tmp.remaining() < Self::ENCODED_LEN {
26622 panic!(
26623 "buffer is too small (need {} bytes, but got {})",
26624 Self::ENCODED_LEN,
26625 __tmp.remaining(),
26626 )
26627 }
26628 __tmp.put_u16_le(self.req_message_rate);
26629 __tmp.put_u8(self.target_system);
26630 __tmp.put_u8(self.target_component);
26631 __tmp.put_u8(self.req_stream_id);
26632 __tmp.put_u8(self.start_stop);
26633 if matches!(version, MavlinkVersion::V2) {
26634 let len = __tmp.len();
26635 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26636 } else {
26637 __tmp.len()
26638 }
26639 }
26640}
26641#[doc = "Request one or more events to be (re-)sent. If first_sequence==last_sequence, only a single event is requested. Note that first_sequence can be larger than last_sequence (because the sequence number can wrap). Each sequence will trigger an EVENT or EVENT_ERROR response."]
26642#[doc = ""]
26643#[doc = "ID: 412"]
26644#[derive(Debug, Clone, PartialEq)]
26645#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26646#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26647#[cfg_attr(feature = "ts", derive(TS))]
26648#[cfg_attr(feature = "ts", ts(export))]
26649pub struct REQUEST_EVENT_DATA {
26650 #[doc = "First sequence number of the requested event."]
26651 pub first_sequence: u16,
26652 #[doc = "Last sequence number of the requested event."]
26653 pub last_sequence: u16,
26654 #[doc = "System ID"]
26655 pub target_system: u8,
26656 #[doc = "Component ID"]
26657 pub target_component: u8,
26658}
26659impl REQUEST_EVENT_DATA {
26660 pub const ENCODED_LEN: usize = 6usize;
26661 pub const DEFAULT: Self = Self {
26662 first_sequence: 0_u16,
26663 last_sequence: 0_u16,
26664 target_system: 0_u8,
26665 target_component: 0_u8,
26666 };
26667 #[cfg(feature = "arbitrary")]
26668 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26669 use arbitrary::{Arbitrary, Unstructured};
26670 let mut buf = [0u8; 1024];
26671 rng.fill_bytes(&mut buf);
26672 let mut unstructured = Unstructured::new(&buf);
26673 Self::arbitrary(&mut unstructured).unwrap_or_default()
26674 }
26675}
26676impl Default for REQUEST_EVENT_DATA {
26677 fn default() -> Self {
26678 Self::DEFAULT.clone()
26679 }
26680}
26681impl MessageData for REQUEST_EVENT_DATA {
26682 type Message = MavMessage;
26683 const ID: u32 = 412u32;
26684 const NAME: &'static str = "REQUEST_EVENT";
26685 const EXTRA_CRC: u8 = 33u8;
26686 const ENCODED_LEN: usize = 6usize;
26687 fn deser(
26688 _version: MavlinkVersion,
26689 __input: &[u8],
26690 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26691 let avail_len = __input.len();
26692 let mut payload_buf = [0; Self::ENCODED_LEN];
26693 let mut buf = if avail_len < Self::ENCODED_LEN {
26694 payload_buf[0..avail_len].copy_from_slice(__input);
26695 Bytes::new(&payload_buf)
26696 } else {
26697 Bytes::new(__input)
26698 };
26699 let mut __struct = Self::default();
26700 __struct.first_sequence = buf.get_u16_le();
26701 __struct.last_sequence = buf.get_u16_le();
26702 __struct.target_system = buf.get_u8();
26703 __struct.target_component = buf.get_u8();
26704 Ok(__struct)
26705 }
26706 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26707 let mut __tmp = BytesMut::new(bytes);
26708 #[allow(clippy::absurd_extreme_comparisons)]
26709 #[allow(unused_comparisons)]
26710 if __tmp.remaining() < Self::ENCODED_LEN {
26711 panic!(
26712 "buffer is too small (need {} bytes, but got {})",
26713 Self::ENCODED_LEN,
26714 __tmp.remaining(),
26715 )
26716 }
26717 __tmp.put_u16_le(self.first_sequence);
26718 __tmp.put_u16_le(self.last_sequence);
26719 __tmp.put_u8(self.target_system);
26720 __tmp.put_u8(self.target_component);
26721 if matches!(version, MavlinkVersion::V2) {
26722 let len = __tmp.len();
26723 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26724 } else {
26725 __tmp.len()
26726 }
26727 }
26728}
26729#[doc = "The autopilot is requesting a resource (file, binary, other type of data)."]
26730#[doc = ""]
26731#[doc = "ID: 142"]
26732#[derive(Debug, Clone, PartialEq)]
26733#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26734#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26735#[cfg_attr(feature = "ts", derive(TS))]
26736#[cfg_attr(feature = "ts", ts(export))]
26737pub struct RESOURCE_REQUEST_DATA {
26738 #[doc = "Request ID. This ID should be re-used when sending back URI contents"]
26739 pub request_id: u8,
26740 #[doc = "The type of requested URI. 0 = a file via URL. 1 = a UAVCAN binary"]
26741 pub uri_type: u8,
26742 #[doc = "The requested unique resource identifier (URI). It is not necessarily a straight domain name (depends on the URI type enum)"]
26743 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26744 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
26745 pub uri: [u8; 120],
26746 #[doc = "The way the autopilot wants to receive the URI. 0 = MAVLink FTP. 1 = binary stream."]
26747 pub transfer_type: u8,
26748 #[doc = "The storage path the autopilot wants the URI to be stored in. Will only be valid if the transfer_type has a storage associated (e.g. MAVLink FTP)."]
26749 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26750 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
26751 pub storage: [u8; 120],
26752}
26753impl RESOURCE_REQUEST_DATA {
26754 pub const ENCODED_LEN: usize = 243usize;
26755 pub const DEFAULT: Self = Self {
26756 request_id: 0_u8,
26757 uri_type: 0_u8,
26758 uri: [0_u8; 120usize],
26759 transfer_type: 0_u8,
26760 storage: [0_u8; 120usize],
26761 };
26762 #[cfg(feature = "arbitrary")]
26763 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26764 use arbitrary::{Arbitrary, Unstructured};
26765 let mut buf = [0u8; 1024];
26766 rng.fill_bytes(&mut buf);
26767 let mut unstructured = Unstructured::new(&buf);
26768 Self::arbitrary(&mut unstructured).unwrap_or_default()
26769 }
26770}
26771impl Default for RESOURCE_REQUEST_DATA {
26772 fn default() -> Self {
26773 Self::DEFAULT.clone()
26774 }
26775}
26776impl MessageData for RESOURCE_REQUEST_DATA {
26777 type Message = MavMessage;
26778 const ID: u32 = 142u32;
26779 const NAME: &'static str = "RESOURCE_REQUEST";
26780 const EXTRA_CRC: u8 = 72u8;
26781 const ENCODED_LEN: usize = 243usize;
26782 fn deser(
26783 _version: MavlinkVersion,
26784 __input: &[u8],
26785 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26786 let avail_len = __input.len();
26787 let mut payload_buf = [0; Self::ENCODED_LEN];
26788 let mut buf = if avail_len < Self::ENCODED_LEN {
26789 payload_buf[0..avail_len].copy_from_slice(__input);
26790 Bytes::new(&payload_buf)
26791 } else {
26792 Bytes::new(__input)
26793 };
26794 let mut __struct = Self::default();
26795 __struct.request_id = buf.get_u8();
26796 __struct.uri_type = buf.get_u8();
26797 for v in &mut __struct.uri {
26798 let val = buf.get_u8();
26799 *v = val;
26800 }
26801 __struct.transfer_type = buf.get_u8();
26802 for v in &mut __struct.storage {
26803 let val = buf.get_u8();
26804 *v = val;
26805 }
26806 Ok(__struct)
26807 }
26808 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26809 let mut __tmp = BytesMut::new(bytes);
26810 #[allow(clippy::absurd_extreme_comparisons)]
26811 #[allow(unused_comparisons)]
26812 if __tmp.remaining() < Self::ENCODED_LEN {
26813 panic!(
26814 "buffer is too small (need {} bytes, but got {})",
26815 Self::ENCODED_LEN,
26816 __tmp.remaining(),
26817 )
26818 }
26819 __tmp.put_u8(self.request_id);
26820 __tmp.put_u8(self.uri_type);
26821 for val in &self.uri {
26822 __tmp.put_u8(*val);
26823 }
26824 __tmp.put_u8(self.transfer_type);
26825 for val in &self.storage {
26826 __tmp.put_u8(*val);
26827 }
26828 if matches!(version, MavlinkVersion::V2) {
26829 let len = __tmp.len();
26830 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26831 } else {
26832 __tmp.len()
26833 }
26834 }
26835}
26836#[doc = "Response to a REQUEST_EVENT in case of an error (e.g. the event is not available anymore)."]
26837#[doc = ""]
26838#[doc = "ID: 413"]
26839#[derive(Debug, Clone, PartialEq)]
26840#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26841#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26842#[cfg_attr(feature = "ts", derive(TS))]
26843#[cfg_attr(feature = "ts", ts(export))]
26844pub struct RESPONSE_EVENT_ERROR_DATA {
26845 #[doc = "Sequence number."]
26846 pub sequence: u16,
26847 #[doc = "Oldest Sequence number that is still available after the sequence set in REQUEST_EVENT."]
26848 pub sequence_oldest_available: u16,
26849 #[doc = "System ID"]
26850 pub target_system: u8,
26851 #[doc = "Component ID"]
26852 pub target_component: u8,
26853 #[doc = "Error reason."]
26854 pub reason: MavEventErrorReason,
26855}
26856impl RESPONSE_EVENT_ERROR_DATA {
26857 pub const ENCODED_LEN: usize = 7usize;
26858 pub const DEFAULT: Self = Self {
26859 sequence: 0_u16,
26860 sequence_oldest_available: 0_u16,
26861 target_system: 0_u8,
26862 target_component: 0_u8,
26863 reason: MavEventErrorReason::DEFAULT,
26864 };
26865 #[cfg(feature = "arbitrary")]
26866 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26867 use arbitrary::{Arbitrary, Unstructured};
26868 let mut buf = [0u8; 1024];
26869 rng.fill_bytes(&mut buf);
26870 let mut unstructured = Unstructured::new(&buf);
26871 Self::arbitrary(&mut unstructured).unwrap_or_default()
26872 }
26873}
26874impl Default for RESPONSE_EVENT_ERROR_DATA {
26875 fn default() -> Self {
26876 Self::DEFAULT.clone()
26877 }
26878}
26879impl MessageData for RESPONSE_EVENT_ERROR_DATA {
26880 type Message = MavMessage;
26881 const ID: u32 = 413u32;
26882 const NAME: &'static str = "RESPONSE_EVENT_ERROR";
26883 const EXTRA_CRC: u8 = 77u8;
26884 const ENCODED_LEN: usize = 7usize;
26885 fn deser(
26886 _version: MavlinkVersion,
26887 __input: &[u8],
26888 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26889 let avail_len = __input.len();
26890 let mut payload_buf = [0; Self::ENCODED_LEN];
26891 let mut buf = if avail_len < Self::ENCODED_LEN {
26892 payload_buf[0..avail_len].copy_from_slice(__input);
26893 Bytes::new(&payload_buf)
26894 } else {
26895 Bytes::new(__input)
26896 };
26897 let mut __struct = Self::default();
26898 __struct.sequence = buf.get_u16_le();
26899 __struct.sequence_oldest_available = buf.get_u16_le();
26900 __struct.target_system = buf.get_u8();
26901 __struct.target_component = buf.get_u8();
26902 let tmp = buf.get_u8();
26903 __struct.reason =
26904 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
26905 enum_type: "MavEventErrorReason",
26906 value: tmp as u32,
26907 })?;
26908 Ok(__struct)
26909 }
26910 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26911 let mut __tmp = BytesMut::new(bytes);
26912 #[allow(clippy::absurd_extreme_comparisons)]
26913 #[allow(unused_comparisons)]
26914 if __tmp.remaining() < Self::ENCODED_LEN {
26915 panic!(
26916 "buffer is too small (need {} bytes, but got {})",
26917 Self::ENCODED_LEN,
26918 __tmp.remaining(),
26919 )
26920 }
26921 __tmp.put_u16_le(self.sequence);
26922 __tmp.put_u16_le(self.sequence_oldest_available);
26923 __tmp.put_u8(self.target_system);
26924 __tmp.put_u8(self.target_component);
26925 __tmp.put_u8(self.reason as u8);
26926 if matches!(version, MavlinkVersion::V2) {
26927 let len = __tmp.len();
26928 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26929 } else {
26930 __tmp.len()
26931 }
26932 }
26933}
26934#[doc = "Read out the safety zone the MAV currently assumes."]
26935#[doc = ""]
26936#[doc = "ID: 55"]
26937#[derive(Debug, Clone, PartialEq)]
26938#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26939#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26940#[cfg_attr(feature = "ts", derive(TS))]
26941#[cfg_attr(feature = "ts", ts(export))]
26942pub struct SAFETY_ALLOWED_AREA_DATA {
26943 #[doc = "x position 1 / Latitude 1"]
26944 pub p1x: f32,
26945 #[doc = "y position 1 / Longitude 1"]
26946 pub p1y: f32,
26947 #[doc = "z position 1 / Altitude 1"]
26948 pub p1z: f32,
26949 #[doc = "x position 2 / Latitude 2"]
26950 pub p2x: f32,
26951 #[doc = "y position 2 / Longitude 2"]
26952 pub p2y: f32,
26953 #[doc = "z position 2 / Altitude 2"]
26954 pub p2z: f32,
26955 #[doc = "Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down."]
26956 pub frame: MavFrame,
26957}
26958impl SAFETY_ALLOWED_AREA_DATA {
26959 pub const ENCODED_LEN: usize = 25usize;
26960 pub const DEFAULT: Self = Self {
26961 p1x: 0.0_f32,
26962 p1y: 0.0_f32,
26963 p1z: 0.0_f32,
26964 p2x: 0.0_f32,
26965 p2y: 0.0_f32,
26966 p2z: 0.0_f32,
26967 frame: MavFrame::DEFAULT,
26968 };
26969 #[cfg(feature = "arbitrary")]
26970 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26971 use arbitrary::{Arbitrary, Unstructured};
26972 let mut buf = [0u8; 1024];
26973 rng.fill_bytes(&mut buf);
26974 let mut unstructured = Unstructured::new(&buf);
26975 Self::arbitrary(&mut unstructured).unwrap_or_default()
26976 }
26977}
26978impl Default for SAFETY_ALLOWED_AREA_DATA {
26979 fn default() -> Self {
26980 Self::DEFAULT.clone()
26981 }
26982}
26983impl MessageData for SAFETY_ALLOWED_AREA_DATA {
26984 type Message = MavMessage;
26985 const ID: u32 = 55u32;
26986 const NAME: &'static str = "SAFETY_ALLOWED_AREA";
26987 const EXTRA_CRC: u8 = 3u8;
26988 const ENCODED_LEN: usize = 25usize;
26989 fn deser(
26990 _version: MavlinkVersion,
26991 __input: &[u8],
26992 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26993 let avail_len = __input.len();
26994 let mut payload_buf = [0; Self::ENCODED_LEN];
26995 let mut buf = if avail_len < Self::ENCODED_LEN {
26996 payload_buf[0..avail_len].copy_from_slice(__input);
26997 Bytes::new(&payload_buf)
26998 } else {
26999 Bytes::new(__input)
27000 };
27001 let mut __struct = Self::default();
27002 __struct.p1x = buf.get_f32_le();
27003 __struct.p1y = buf.get_f32_le();
27004 __struct.p1z = buf.get_f32_le();
27005 __struct.p2x = buf.get_f32_le();
27006 __struct.p2y = buf.get_f32_le();
27007 __struct.p2z = buf.get_f32_le();
27008 let tmp = buf.get_u8();
27009 __struct.frame =
27010 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27011 enum_type: "MavFrame",
27012 value: tmp as u32,
27013 })?;
27014 Ok(__struct)
27015 }
27016 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27017 let mut __tmp = BytesMut::new(bytes);
27018 #[allow(clippy::absurd_extreme_comparisons)]
27019 #[allow(unused_comparisons)]
27020 if __tmp.remaining() < Self::ENCODED_LEN {
27021 panic!(
27022 "buffer is too small (need {} bytes, but got {})",
27023 Self::ENCODED_LEN,
27024 __tmp.remaining(),
27025 )
27026 }
27027 __tmp.put_f32_le(self.p1x);
27028 __tmp.put_f32_le(self.p1y);
27029 __tmp.put_f32_le(self.p1z);
27030 __tmp.put_f32_le(self.p2x);
27031 __tmp.put_f32_le(self.p2y);
27032 __tmp.put_f32_le(self.p2z);
27033 __tmp.put_u8(self.frame as u8);
27034 if matches!(version, MavlinkVersion::V2) {
27035 let len = __tmp.len();
27036 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27037 } else {
27038 __tmp.len()
27039 }
27040 }
27041}
27042#[doc = "Set a safety zone (volume), which is defined by two corners of a cube. This message can be used to tell the MAV which setpoints/waypoints to accept and which to reject. Safety areas are often enforced by national or competition regulations."]
27043#[doc = ""]
27044#[doc = "ID: 54"]
27045#[derive(Debug, Clone, PartialEq)]
27046#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27047#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27048#[cfg_attr(feature = "ts", derive(TS))]
27049#[cfg_attr(feature = "ts", ts(export))]
27050pub struct SAFETY_SET_ALLOWED_AREA_DATA {
27051 #[doc = "x position 1 / Latitude 1"]
27052 pub p1x: f32,
27053 #[doc = "y position 1 / Longitude 1"]
27054 pub p1y: f32,
27055 #[doc = "z position 1 / Altitude 1"]
27056 pub p1z: f32,
27057 #[doc = "x position 2 / Latitude 2"]
27058 pub p2x: f32,
27059 #[doc = "y position 2 / Longitude 2"]
27060 pub p2y: f32,
27061 #[doc = "z position 2 / Altitude 2"]
27062 pub p2z: f32,
27063 #[doc = "System ID"]
27064 pub target_system: u8,
27065 #[doc = "Component ID"]
27066 pub target_component: u8,
27067 #[doc = "Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down."]
27068 pub frame: MavFrame,
27069}
27070impl SAFETY_SET_ALLOWED_AREA_DATA {
27071 pub const ENCODED_LEN: usize = 27usize;
27072 pub const DEFAULT: Self = Self {
27073 p1x: 0.0_f32,
27074 p1y: 0.0_f32,
27075 p1z: 0.0_f32,
27076 p2x: 0.0_f32,
27077 p2y: 0.0_f32,
27078 p2z: 0.0_f32,
27079 target_system: 0_u8,
27080 target_component: 0_u8,
27081 frame: MavFrame::DEFAULT,
27082 };
27083 #[cfg(feature = "arbitrary")]
27084 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27085 use arbitrary::{Arbitrary, Unstructured};
27086 let mut buf = [0u8; 1024];
27087 rng.fill_bytes(&mut buf);
27088 let mut unstructured = Unstructured::new(&buf);
27089 Self::arbitrary(&mut unstructured).unwrap_or_default()
27090 }
27091}
27092impl Default for SAFETY_SET_ALLOWED_AREA_DATA {
27093 fn default() -> Self {
27094 Self::DEFAULT.clone()
27095 }
27096}
27097impl MessageData for SAFETY_SET_ALLOWED_AREA_DATA {
27098 type Message = MavMessage;
27099 const ID: u32 = 54u32;
27100 const NAME: &'static str = "SAFETY_SET_ALLOWED_AREA";
27101 const EXTRA_CRC: u8 = 15u8;
27102 const ENCODED_LEN: usize = 27usize;
27103 fn deser(
27104 _version: MavlinkVersion,
27105 __input: &[u8],
27106 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27107 let avail_len = __input.len();
27108 let mut payload_buf = [0; Self::ENCODED_LEN];
27109 let mut buf = if avail_len < Self::ENCODED_LEN {
27110 payload_buf[0..avail_len].copy_from_slice(__input);
27111 Bytes::new(&payload_buf)
27112 } else {
27113 Bytes::new(__input)
27114 };
27115 let mut __struct = Self::default();
27116 __struct.p1x = buf.get_f32_le();
27117 __struct.p1y = buf.get_f32_le();
27118 __struct.p1z = buf.get_f32_le();
27119 __struct.p2x = buf.get_f32_le();
27120 __struct.p2y = buf.get_f32_le();
27121 __struct.p2z = buf.get_f32_le();
27122 __struct.target_system = buf.get_u8();
27123 __struct.target_component = buf.get_u8();
27124 let tmp = buf.get_u8();
27125 __struct.frame =
27126 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27127 enum_type: "MavFrame",
27128 value: tmp as u32,
27129 })?;
27130 Ok(__struct)
27131 }
27132 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27133 let mut __tmp = BytesMut::new(bytes);
27134 #[allow(clippy::absurd_extreme_comparisons)]
27135 #[allow(unused_comparisons)]
27136 if __tmp.remaining() < Self::ENCODED_LEN {
27137 panic!(
27138 "buffer is too small (need {} bytes, but got {})",
27139 Self::ENCODED_LEN,
27140 __tmp.remaining(),
27141 )
27142 }
27143 __tmp.put_f32_le(self.p1x);
27144 __tmp.put_f32_le(self.p1y);
27145 __tmp.put_f32_le(self.p1z);
27146 __tmp.put_f32_le(self.p2x);
27147 __tmp.put_f32_le(self.p2y);
27148 __tmp.put_f32_le(self.p2z);
27149 __tmp.put_u8(self.target_system);
27150 __tmp.put_u8(self.target_component);
27151 __tmp.put_u8(self.frame as u8);
27152 if matches!(version, MavlinkVersion::V2) {
27153 let len = __tmp.len();
27154 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27155 } else {
27156 __tmp.len()
27157 }
27158 }
27159}
27160#[doc = "The RAW IMU readings for the usual 9DOF sensor setup. This message should contain the scaled values to the described units."]
27161#[doc = ""]
27162#[doc = "ID: 26"]
27163#[derive(Debug, Clone, PartialEq)]
27164#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27165#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27166#[cfg_attr(feature = "ts", derive(TS))]
27167#[cfg_attr(feature = "ts", ts(export))]
27168pub struct SCALED_IMU_DATA {
27169 #[doc = "Timestamp (time since system boot)."]
27170 pub time_boot_ms: u32,
27171 #[doc = "X acceleration"]
27172 pub xacc: i16,
27173 #[doc = "Y acceleration"]
27174 pub yacc: i16,
27175 #[doc = "Z acceleration"]
27176 pub zacc: i16,
27177 #[doc = "Angular speed around X axis"]
27178 pub xgyro: i16,
27179 #[doc = "Angular speed around Y axis"]
27180 pub ygyro: i16,
27181 #[doc = "Angular speed around Z axis"]
27182 pub zgyro: i16,
27183 #[doc = "X Magnetic field"]
27184 pub xmag: i16,
27185 #[doc = "Y Magnetic field"]
27186 pub ymag: i16,
27187 #[doc = "Z Magnetic field"]
27188 pub zmag: i16,
27189 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
27190 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27191 pub temperature: i16,
27192}
27193impl SCALED_IMU_DATA {
27194 pub const ENCODED_LEN: usize = 24usize;
27195 pub const DEFAULT: Self = Self {
27196 time_boot_ms: 0_u32,
27197 xacc: 0_i16,
27198 yacc: 0_i16,
27199 zacc: 0_i16,
27200 xgyro: 0_i16,
27201 ygyro: 0_i16,
27202 zgyro: 0_i16,
27203 xmag: 0_i16,
27204 ymag: 0_i16,
27205 zmag: 0_i16,
27206 temperature: 0_i16,
27207 };
27208 #[cfg(feature = "arbitrary")]
27209 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27210 use arbitrary::{Arbitrary, Unstructured};
27211 let mut buf = [0u8; 1024];
27212 rng.fill_bytes(&mut buf);
27213 let mut unstructured = Unstructured::new(&buf);
27214 Self::arbitrary(&mut unstructured).unwrap_or_default()
27215 }
27216}
27217impl Default for SCALED_IMU_DATA {
27218 fn default() -> Self {
27219 Self::DEFAULT.clone()
27220 }
27221}
27222impl MessageData for SCALED_IMU_DATA {
27223 type Message = MavMessage;
27224 const ID: u32 = 26u32;
27225 const NAME: &'static str = "SCALED_IMU";
27226 const EXTRA_CRC: u8 = 170u8;
27227 const ENCODED_LEN: usize = 24usize;
27228 fn deser(
27229 _version: MavlinkVersion,
27230 __input: &[u8],
27231 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27232 let avail_len = __input.len();
27233 let mut payload_buf = [0; Self::ENCODED_LEN];
27234 let mut buf = if avail_len < Self::ENCODED_LEN {
27235 payload_buf[0..avail_len].copy_from_slice(__input);
27236 Bytes::new(&payload_buf)
27237 } else {
27238 Bytes::new(__input)
27239 };
27240 let mut __struct = Self::default();
27241 __struct.time_boot_ms = buf.get_u32_le();
27242 __struct.xacc = buf.get_i16_le();
27243 __struct.yacc = buf.get_i16_le();
27244 __struct.zacc = buf.get_i16_le();
27245 __struct.xgyro = buf.get_i16_le();
27246 __struct.ygyro = buf.get_i16_le();
27247 __struct.zgyro = buf.get_i16_le();
27248 __struct.xmag = buf.get_i16_le();
27249 __struct.ymag = buf.get_i16_le();
27250 __struct.zmag = buf.get_i16_le();
27251 __struct.temperature = buf.get_i16_le();
27252 Ok(__struct)
27253 }
27254 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27255 let mut __tmp = BytesMut::new(bytes);
27256 #[allow(clippy::absurd_extreme_comparisons)]
27257 #[allow(unused_comparisons)]
27258 if __tmp.remaining() < Self::ENCODED_LEN {
27259 panic!(
27260 "buffer is too small (need {} bytes, but got {})",
27261 Self::ENCODED_LEN,
27262 __tmp.remaining(),
27263 )
27264 }
27265 __tmp.put_u32_le(self.time_boot_ms);
27266 __tmp.put_i16_le(self.xacc);
27267 __tmp.put_i16_le(self.yacc);
27268 __tmp.put_i16_le(self.zacc);
27269 __tmp.put_i16_le(self.xgyro);
27270 __tmp.put_i16_le(self.ygyro);
27271 __tmp.put_i16_le(self.zgyro);
27272 __tmp.put_i16_le(self.xmag);
27273 __tmp.put_i16_le(self.ymag);
27274 __tmp.put_i16_le(self.zmag);
27275 if matches!(version, MavlinkVersion::V2) {
27276 __tmp.put_i16_le(self.temperature);
27277 let len = __tmp.len();
27278 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27279 } else {
27280 __tmp.len()
27281 }
27282 }
27283}
27284#[doc = "The RAW IMU readings for secondary 9DOF sensor setup. This message should contain the scaled values to the described units."]
27285#[doc = ""]
27286#[doc = "ID: 116"]
27287#[derive(Debug, Clone, PartialEq)]
27288#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27289#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27290#[cfg_attr(feature = "ts", derive(TS))]
27291#[cfg_attr(feature = "ts", ts(export))]
27292pub struct SCALED_IMU2_DATA {
27293 #[doc = "Timestamp (time since system boot)."]
27294 pub time_boot_ms: u32,
27295 #[doc = "X acceleration"]
27296 pub xacc: i16,
27297 #[doc = "Y acceleration"]
27298 pub yacc: i16,
27299 #[doc = "Z acceleration"]
27300 pub zacc: i16,
27301 #[doc = "Angular speed around X axis"]
27302 pub xgyro: i16,
27303 #[doc = "Angular speed around Y axis"]
27304 pub ygyro: i16,
27305 #[doc = "Angular speed around Z axis"]
27306 pub zgyro: i16,
27307 #[doc = "X Magnetic field"]
27308 pub xmag: i16,
27309 #[doc = "Y Magnetic field"]
27310 pub ymag: i16,
27311 #[doc = "Z Magnetic field"]
27312 pub zmag: i16,
27313 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
27314 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27315 pub temperature: i16,
27316}
27317impl SCALED_IMU2_DATA {
27318 pub const ENCODED_LEN: usize = 24usize;
27319 pub const DEFAULT: Self = Self {
27320 time_boot_ms: 0_u32,
27321 xacc: 0_i16,
27322 yacc: 0_i16,
27323 zacc: 0_i16,
27324 xgyro: 0_i16,
27325 ygyro: 0_i16,
27326 zgyro: 0_i16,
27327 xmag: 0_i16,
27328 ymag: 0_i16,
27329 zmag: 0_i16,
27330 temperature: 0_i16,
27331 };
27332 #[cfg(feature = "arbitrary")]
27333 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27334 use arbitrary::{Arbitrary, Unstructured};
27335 let mut buf = [0u8; 1024];
27336 rng.fill_bytes(&mut buf);
27337 let mut unstructured = Unstructured::new(&buf);
27338 Self::arbitrary(&mut unstructured).unwrap_or_default()
27339 }
27340}
27341impl Default for SCALED_IMU2_DATA {
27342 fn default() -> Self {
27343 Self::DEFAULT.clone()
27344 }
27345}
27346impl MessageData for SCALED_IMU2_DATA {
27347 type Message = MavMessage;
27348 const ID: u32 = 116u32;
27349 const NAME: &'static str = "SCALED_IMU2";
27350 const EXTRA_CRC: u8 = 76u8;
27351 const ENCODED_LEN: usize = 24usize;
27352 fn deser(
27353 _version: MavlinkVersion,
27354 __input: &[u8],
27355 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27356 let avail_len = __input.len();
27357 let mut payload_buf = [0; Self::ENCODED_LEN];
27358 let mut buf = if avail_len < Self::ENCODED_LEN {
27359 payload_buf[0..avail_len].copy_from_slice(__input);
27360 Bytes::new(&payload_buf)
27361 } else {
27362 Bytes::new(__input)
27363 };
27364 let mut __struct = Self::default();
27365 __struct.time_boot_ms = buf.get_u32_le();
27366 __struct.xacc = buf.get_i16_le();
27367 __struct.yacc = buf.get_i16_le();
27368 __struct.zacc = buf.get_i16_le();
27369 __struct.xgyro = buf.get_i16_le();
27370 __struct.ygyro = buf.get_i16_le();
27371 __struct.zgyro = buf.get_i16_le();
27372 __struct.xmag = buf.get_i16_le();
27373 __struct.ymag = buf.get_i16_le();
27374 __struct.zmag = buf.get_i16_le();
27375 __struct.temperature = buf.get_i16_le();
27376 Ok(__struct)
27377 }
27378 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27379 let mut __tmp = BytesMut::new(bytes);
27380 #[allow(clippy::absurd_extreme_comparisons)]
27381 #[allow(unused_comparisons)]
27382 if __tmp.remaining() < Self::ENCODED_LEN {
27383 panic!(
27384 "buffer is too small (need {} bytes, but got {})",
27385 Self::ENCODED_LEN,
27386 __tmp.remaining(),
27387 )
27388 }
27389 __tmp.put_u32_le(self.time_boot_ms);
27390 __tmp.put_i16_le(self.xacc);
27391 __tmp.put_i16_le(self.yacc);
27392 __tmp.put_i16_le(self.zacc);
27393 __tmp.put_i16_le(self.xgyro);
27394 __tmp.put_i16_le(self.ygyro);
27395 __tmp.put_i16_le(self.zgyro);
27396 __tmp.put_i16_le(self.xmag);
27397 __tmp.put_i16_le(self.ymag);
27398 __tmp.put_i16_le(self.zmag);
27399 if matches!(version, MavlinkVersion::V2) {
27400 __tmp.put_i16_le(self.temperature);
27401 let len = __tmp.len();
27402 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27403 } else {
27404 __tmp.len()
27405 }
27406 }
27407}
27408#[doc = "The RAW IMU readings for 3rd 9DOF sensor setup. This message should contain the scaled values to the described units."]
27409#[doc = ""]
27410#[doc = "ID: 129"]
27411#[derive(Debug, Clone, PartialEq)]
27412#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27413#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27414#[cfg_attr(feature = "ts", derive(TS))]
27415#[cfg_attr(feature = "ts", ts(export))]
27416pub struct SCALED_IMU3_DATA {
27417 #[doc = "Timestamp (time since system boot)."]
27418 pub time_boot_ms: u32,
27419 #[doc = "X acceleration"]
27420 pub xacc: i16,
27421 #[doc = "Y acceleration"]
27422 pub yacc: i16,
27423 #[doc = "Z acceleration"]
27424 pub zacc: i16,
27425 #[doc = "Angular speed around X axis"]
27426 pub xgyro: i16,
27427 #[doc = "Angular speed around Y axis"]
27428 pub ygyro: i16,
27429 #[doc = "Angular speed around Z axis"]
27430 pub zgyro: i16,
27431 #[doc = "X Magnetic field"]
27432 pub xmag: i16,
27433 #[doc = "Y Magnetic field"]
27434 pub ymag: i16,
27435 #[doc = "Z Magnetic field"]
27436 pub zmag: i16,
27437 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
27438 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27439 pub temperature: i16,
27440}
27441impl SCALED_IMU3_DATA {
27442 pub const ENCODED_LEN: usize = 24usize;
27443 pub const DEFAULT: Self = Self {
27444 time_boot_ms: 0_u32,
27445 xacc: 0_i16,
27446 yacc: 0_i16,
27447 zacc: 0_i16,
27448 xgyro: 0_i16,
27449 ygyro: 0_i16,
27450 zgyro: 0_i16,
27451 xmag: 0_i16,
27452 ymag: 0_i16,
27453 zmag: 0_i16,
27454 temperature: 0_i16,
27455 };
27456 #[cfg(feature = "arbitrary")]
27457 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27458 use arbitrary::{Arbitrary, Unstructured};
27459 let mut buf = [0u8; 1024];
27460 rng.fill_bytes(&mut buf);
27461 let mut unstructured = Unstructured::new(&buf);
27462 Self::arbitrary(&mut unstructured).unwrap_or_default()
27463 }
27464}
27465impl Default for SCALED_IMU3_DATA {
27466 fn default() -> Self {
27467 Self::DEFAULT.clone()
27468 }
27469}
27470impl MessageData for SCALED_IMU3_DATA {
27471 type Message = MavMessage;
27472 const ID: u32 = 129u32;
27473 const NAME: &'static str = "SCALED_IMU3";
27474 const EXTRA_CRC: u8 = 46u8;
27475 const ENCODED_LEN: usize = 24usize;
27476 fn deser(
27477 _version: MavlinkVersion,
27478 __input: &[u8],
27479 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27480 let avail_len = __input.len();
27481 let mut payload_buf = [0; Self::ENCODED_LEN];
27482 let mut buf = if avail_len < Self::ENCODED_LEN {
27483 payload_buf[0..avail_len].copy_from_slice(__input);
27484 Bytes::new(&payload_buf)
27485 } else {
27486 Bytes::new(__input)
27487 };
27488 let mut __struct = Self::default();
27489 __struct.time_boot_ms = buf.get_u32_le();
27490 __struct.xacc = buf.get_i16_le();
27491 __struct.yacc = buf.get_i16_le();
27492 __struct.zacc = buf.get_i16_le();
27493 __struct.xgyro = buf.get_i16_le();
27494 __struct.ygyro = buf.get_i16_le();
27495 __struct.zgyro = buf.get_i16_le();
27496 __struct.xmag = buf.get_i16_le();
27497 __struct.ymag = buf.get_i16_le();
27498 __struct.zmag = buf.get_i16_le();
27499 __struct.temperature = buf.get_i16_le();
27500 Ok(__struct)
27501 }
27502 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27503 let mut __tmp = BytesMut::new(bytes);
27504 #[allow(clippy::absurd_extreme_comparisons)]
27505 #[allow(unused_comparisons)]
27506 if __tmp.remaining() < Self::ENCODED_LEN {
27507 panic!(
27508 "buffer is too small (need {} bytes, but got {})",
27509 Self::ENCODED_LEN,
27510 __tmp.remaining(),
27511 )
27512 }
27513 __tmp.put_u32_le(self.time_boot_ms);
27514 __tmp.put_i16_le(self.xacc);
27515 __tmp.put_i16_le(self.yacc);
27516 __tmp.put_i16_le(self.zacc);
27517 __tmp.put_i16_le(self.xgyro);
27518 __tmp.put_i16_le(self.ygyro);
27519 __tmp.put_i16_le(self.zgyro);
27520 __tmp.put_i16_le(self.xmag);
27521 __tmp.put_i16_le(self.ymag);
27522 __tmp.put_i16_le(self.zmag);
27523 if matches!(version, MavlinkVersion::V2) {
27524 __tmp.put_i16_le(self.temperature);
27525 let len = __tmp.len();
27526 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27527 } else {
27528 __tmp.len()
27529 }
27530 }
27531}
27532#[doc = "The pressure readings for the typical setup of one absolute and differential pressure sensor. The units are as specified in each field."]
27533#[doc = ""]
27534#[doc = "ID: 29"]
27535#[derive(Debug, Clone, PartialEq)]
27536#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27537#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27538#[cfg_attr(feature = "ts", derive(TS))]
27539#[cfg_attr(feature = "ts", ts(export))]
27540pub struct SCALED_PRESSURE_DATA {
27541 #[doc = "Timestamp (time since system boot)."]
27542 pub time_boot_ms: u32,
27543 #[doc = "Absolute pressure"]
27544 pub press_abs: f32,
27545 #[doc = "Differential pressure 1"]
27546 pub press_diff: f32,
27547 #[doc = "Absolute pressure temperature"]
27548 pub temperature: i16,
27549 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
27550 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27551 pub temperature_press_diff: i16,
27552}
27553impl SCALED_PRESSURE_DATA {
27554 pub const ENCODED_LEN: usize = 16usize;
27555 pub const DEFAULT: Self = Self {
27556 time_boot_ms: 0_u32,
27557 press_abs: 0.0_f32,
27558 press_diff: 0.0_f32,
27559 temperature: 0_i16,
27560 temperature_press_diff: 0_i16,
27561 };
27562 #[cfg(feature = "arbitrary")]
27563 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27564 use arbitrary::{Arbitrary, Unstructured};
27565 let mut buf = [0u8; 1024];
27566 rng.fill_bytes(&mut buf);
27567 let mut unstructured = Unstructured::new(&buf);
27568 Self::arbitrary(&mut unstructured).unwrap_or_default()
27569 }
27570}
27571impl Default for SCALED_PRESSURE_DATA {
27572 fn default() -> Self {
27573 Self::DEFAULT.clone()
27574 }
27575}
27576impl MessageData for SCALED_PRESSURE_DATA {
27577 type Message = MavMessage;
27578 const ID: u32 = 29u32;
27579 const NAME: &'static str = "SCALED_PRESSURE";
27580 const EXTRA_CRC: u8 = 115u8;
27581 const ENCODED_LEN: usize = 16usize;
27582 fn deser(
27583 _version: MavlinkVersion,
27584 __input: &[u8],
27585 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27586 let avail_len = __input.len();
27587 let mut payload_buf = [0; Self::ENCODED_LEN];
27588 let mut buf = if avail_len < Self::ENCODED_LEN {
27589 payload_buf[0..avail_len].copy_from_slice(__input);
27590 Bytes::new(&payload_buf)
27591 } else {
27592 Bytes::new(__input)
27593 };
27594 let mut __struct = Self::default();
27595 __struct.time_boot_ms = buf.get_u32_le();
27596 __struct.press_abs = buf.get_f32_le();
27597 __struct.press_diff = buf.get_f32_le();
27598 __struct.temperature = buf.get_i16_le();
27599 __struct.temperature_press_diff = buf.get_i16_le();
27600 Ok(__struct)
27601 }
27602 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27603 let mut __tmp = BytesMut::new(bytes);
27604 #[allow(clippy::absurd_extreme_comparisons)]
27605 #[allow(unused_comparisons)]
27606 if __tmp.remaining() < Self::ENCODED_LEN {
27607 panic!(
27608 "buffer is too small (need {} bytes, but got {})",
27609 Self::ENCODED_LEN,
27610 __tmp.remaining(),
27611 )
27612 }
27613 __tmp.put_u32_le(self.time_boot_ms);
27614 __tmp.put_f32_le(self.press_abs);
27615 __tmp.put_f32_le(self.press_diff);
27616 __tmp.put_i16_le(self.temperature);
27617 if matches!(version, MavlinkVersion::V2) {
27618 __tmp.put_i16_le(self.temperature_press_diff);
27619 let len = __tmp.len();
27620 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27621 } else {
27622 __tmp.len()
27623 }
27624 }
27625}
27626#[doc = "Barometer readings for 2nd barometer."]
27627#[doc = ""]
27628#[doc = "ID: 137"]
27629#[derive(Debug, Clone, PartialEq)]
27630#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27631#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27632#[cfg_attr(feature = "ts", derive(TS))]
27633#[cfg_attr(feature = "ts", ts(export))]
27634pub struct SCALED_PRESSURE2_DATA {
27635 #[doc = "Timestamp (time since system boot)."]
27636 pub time_boot_ms: u32,
27637 #[doc = "Absolute pressure"]
27638 pub press_abs: f32,
27639 #[doc = "Differential pressure"]
27640 pub press_diff: f32,
27641 #[doc = "Absolute pressure temperature"]
27642 pub temperature: i16,
27643 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
27644 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27645 pub temperature_press_diff: i16,
27646}
27647impl SCALED_PRESSURE2_DATA {
27648 pub const ENCODED_LEN: usize = 16usize;
27649 pub const DEFAULT: Self = Self {
27650 time_boot_ms: 0_u32,
27651 press_abs: 0.0_f32,
27652 press_diff: 0.0_f32,
27653 temperature: 0_i16,
27654 temperature_press_diff: 0_i16,
27655 };
27656 #[cfg(feature = "arbitrary")]
27657 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27658 use arbitrary::{Arbitrary, Unstructured};
27659 let mut buf = [0u8; 1024];
27660 rng.fill_bytes(&mut buf);
27661 let mut unstructured = Unstructured::new(&buf);
27662 Self::arbitrary(&mut unstructured).unwrap_or_default()
27663 }
27664}
27665impl Default for SCALED_PRESSURE2_DATA {
27666 fn default() -> Self {
27667 Self::DEFAULT.clone()
27668 }
27669}
27670impl MessageData for SCALED_PRESSURE2_DATA {
27671 type Message = MavMessage;
27672 const ID: u32 = 137u32;
27673 const NAME: &'static str = "SCALED_PRESSURE2";
27674 const EXTRA_CRC: u8 = 195u8;
27675 const ENCODED_LEN: usize = 16usize;
27676 fn deser(
27677 _version: MavlinkVersion,
27678 __input: &[u8],
27679 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27680 let avail_len = __input.len();
27681 let mut payload_buf = [0; Self::ENCODED_LEN];
27682 let mut buf = if avail_len < Self::ENCODED_LEN {
27683 payload_buf[0..avail_len].copy_from_slice(__input);
27684 Bytes::new(&payload_buf)
27685 } else {
27686 Bytes::new(__input)
27687 };
27688 let mut __struct = Self::default();
27689 __struct.time_boot_ms = buf.get_u32_le();
27690 __struct.press_abs = buf.get_f32_le();
27691 __struct.press_diff = buf.get_f32_le();
27692 __struct.temperature = buf.get_i16_le();
27693 __struct.temperature_press_diff = buf.get_i16_le();
27694 Ok(__struct)
27695 }
27696 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27697 let mut __tmp = BytesMut::new(bytes);
27698 #[allow(clippy::absurd_extreme_comparisons)]
27699 #[allow(unused_comparisons)]
27700 if __tmp.remaining() < Self::ENCODED_LEN {
27701 panic!(
27702 "buffer is too small (need {} bytes, but got {})",
27703 Self::ENCODED_LEN,
27704 __tmp.remaining(),
27705 )
27706 }
27707 __tmp.put_u32_le(self.time_boot_ms);
27708 __tmp.put_f32_le(self.press_abs);
27709 __tmp.put_f32_le(self.press_diff);
27710 __tmp.put_i16_le(self.temperature);
27711 if matches!(version, MavlinkVersion::V2) {
27712 __tmp.put_i16_le(self.temperature_press_diff);
27713 let len = __tmp.len();
27714 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27715 } else {
27716 __tmp.len()
27717 }
27718 }
27719}
27720#[doc = "Barometer readings for 3rd barometer."]
27721#[doc = ""]
27722#[doc = "ID: 143"]
27723#[derive(Debug, Clone, PartialEq)]
27724#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27725#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27726#[cfg_attr(feature = "ts", derive(TS))]
27727#[cfg_attr(feature = "ts", ts(export))]
27728pub struct SCALED_PRESSURE3_DATA {
27729 #[doc = "Timestamp (time since system boot)."]
27730 pub time_boot_ms: u32,
27731 #[doc = "Absolute pressure"]
27732 pub press_abs: f32,
27733 #[doc = "Differential pressure"]
27734 pub press_diff: f32,
27735 #[doc = "Absolute pressure temperature"]
27736 pub temperature: i16,
27737 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
27738 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27739 pub temperature_press_diff: i16,
27740}
27741impl SCALED_PRESSURE3_DATA {
27742 pub const ENCODED_LEN: usize = 16usize;
27743 pub const DEFAULT: Self = Self {
27744 time_boot_ms: 0_u32,
27745 press_abs: 0.0_f32,
27746 press_diff: 0.0_f32,
27747 temperature: 0_i16,
27748 temperature_press_diff: 0_i16,
27749 };
27750 #[cfg(feature = "arbitrary")]
27751 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27752 use arbitrary::{Arbitrary, Unstructured};
27753 let mut buf = [0u8; 1024];
27754 rng.fill_bytes(&mut buf);
27755 let mut unstructured = Unstructured::new(&buf);
27756 Self::arbitrary(&mut unstructured).unwrap_or_default()
27757 }
27758}
27759impl Default for SCALED_PRESSURE3_DATA {
27760 fn default() -> Self {
27761 Self::DEFAULT.clone()
27762 }
27763}
27764impl MessageData for SCALED_PRESSURE3_DATA {
27765 type Message = MavMessage;
27766 const ID: u32 = 143u32;
27767 const NAME: &'static str = "SCALED_PRESSURE3";
27768 const EXTRA_CRC: u8 = 131u8;
27769 const ENCODED_LEN: usize = 16usize;
27770 fn deser(
27771 _version: MavlinkVersion,
27772 __input: &[u8],
27773 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27774 let avail_len = __input.len();
27775 let mut payload_buf = [0; Self::ENCODED_LEN];
27776 let mut buf = if avail_len < Self::ENCODED_LEN {
27777 payload_buf[0..avail_len].copy_from_slice(__input);
27778 Bytes::new(&payload_buf)
27779 } else {
27780 Bytes::new(__input)
27781 };
27782 let mut __struct = Self::default();
27783 __struct.time_boot_ms = buf.get_u32_le();
27784 __struct.press_abs = buf.get_f32_le();
27785 __struct.press_diff = buf.get_f32_le();
27786 __struct.temperature = buf.get_i16_le();
27787 __struct.temperature_press_diff = buf.get_i16_le();
27788 Ok(__struct)
27789 }
27790 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27791 let mut __tmp = BytesMut::new(bytes);
27792 #[allow(clippy::absurd_extreme_comparisons)]
27793 #[allow(unused_comparisons)]
27794 if __tmp.remaining() < Self::ENCODED_LEN {
27795 panic!(
27796 "buffer is too small (need {} bytes, but got {})",
27797 Self::ENCODED_LEN,
27798 __tmp.remaining(),
27799 )
27800 }
27801 __tmp.put_u32_le(self.time_boot_ms);
27802 __tmp.put_f32_le(self.press_abs);
27803 __tmp.put_f32_le(self.press_diff);
27804 __tmp.put_i16_le(self.temperature);
27805 if matches!(version, MavlinkVersion::V2) {
27806 __tmp.put_i16_le(self.temperature_press_diff);
27807 let len = __tmp.len();
27808 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27809 } else {
27810 __tmp.len()
27811 }
27812 }
27813}
27814#[doc = "Control a serial port. This can be used for raw access to an onboard serial peripheral such as a GPS or telemetry radio. It is designed to make it possible to update the devices firmware via MAVLink messages or change the devices settings. A message with zero bytes can be used to change just the baudrate."]
27815#[doc = ""]
27816#[doc = "ID: 126"]
27817#[derive(Debug, Clone, PartialEq)]
27818#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27819#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27820#[cfg_attr(feature = "ts", derive(TS))]
27821#[cfg_attr(feature = "ts", ts(export))]
27822pub struct SERIAL_CONTROL_DATA {
27823 #[doc = "Baudrate of transfer. Zero means no change."]
27824 pub baudrate: u32,
27825 #[doc = "Timeout for reply data"]
27826 pub timeout: u16,
27827 #[doc = "Serial control device type."]
27828 pub device: SerialControlDev,
27829 #[doc = "Bitmap of serial control flags."]
27830 pub flags: SerialControlFlag,
27831 #[doc = "how many bytes in this transfer"]
27832 pub count: u8,
27833 #[doc = "serial data"]
27834 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27835 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
27836 pub data: [u8; 70],
27837 #[doc = "System ID"]
27838 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27839 pub target_system: u8,
27840 #[doc = "Component ID"]
27841 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27842 pub target_component: u8,
27843}
27844impl SERIAL_CONTROL_DATA {
27845 pub const ENCODED_LEN: usize = 81usize;
27846 pub const DEFAULT: Self = Self {
27847 baudrate: 0_u32,
27848 timeout: 0_u16,
27849 device: SerialControlDev::DEFAULT,
27850 flags: SerialControlFlag::DEFAULT,
27851 count: 0_u8,
27852 data: [0_u8; 70usize],
27853 target_system: 0_u8,
27854 target_component: 0_u8,
27855 };
27856 #[cfg(feature = "arbitrary")]
27857 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27858 use arbitrary::{Arbitrary, Unstructured};
27859 let mut buf = [0u8; 1024];
27860 rng.fill_bytes(&mut buf);
27861 let mut unstructured = Unstructured::new(&buf);
27862 Self::arbitrary(&mut unstructured).unwrap_or_default()
27863 }
27864}
27865impl Default for SERIAL_CONTROL_DATA {
27866 fn default() -> Self {
27867 Self::DEFAULT.clone()
27868 }
27869}
27870impl MessageData for SERIAL_CONTROL_DATA {
27871 type Message = MavMessage;
27872 const ID: u32 = 126u32;
27873 const NAME: &'static str = "SERIAL_CONTROL";
27874 const EXTRA_CRC: u8 = 220u8;
27875 const ENCODED_LEN: usize = 81usize;
27876 fn deser(
27877 _version: MavlinkVersion,
27878 __input: &[u8],
27879 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27880 let avail_len = __input.len();
27881 let mut payload_buf = [0; Self::ENCODED_LEN];
27882 let mut buf = if avail_len < Self::ENCODED_LEN {
27883 payload_buf[0..avail_len].copy_from_slice(__input);
27884 Bytes::new(&payload_buf)
27885 } else {
27886 Bytes::new(__input)
27887 };
27888 let mut __struct = Self::default();
27889 __struct.baudrate = buf.get_u32_le();
27890 __struct.timeout = buf.get_u16_le();
27891 let tmp = buf.get_u8();
27892 __struct.device =
27893 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27894 enum_type: "SerialControlDev",
27895 value: tmp as u32,
27896 })?;
27897 let tmp = buf.get_u8();
27898 __struct.flags = SerialControlFlag::from_bits(tmp & SerialControlFlag::all().bits())
27899 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
27900 flag_type: "SerialControlFlag",
27901 value: tmp as u32,
27902 })?;
27903 __struct.count = buf.get_u8();
27904 for v in &mut __struct.data {
27905 let val = buf.get_u8();
27906 *v = val;
27907 }
27908 __struct.target_system = buf.get_u8();
27909 __struct.target_component = buf.get_u8();
27910 Ok(__struct)
27911 }
27912 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27913 let mut __tmp = BytesMut::new(bytes);
27914 #[allow(clippy::absurd_extreme_comparisons)]
27915 #[allow(unused_comparisons)]
27916 if __tmp.remaining() < Self::ENCODED_LEN {
27917 panic!(
27918 "buffer is too small (need {} bytes, but got {})",
27919 Self::ENCODED_LEN,
27920 __tmp.remaining(),
27921 )
27922 }
27923 __tmp.put_u32_le(self.baudrate);
27924 __tmp.put_u16_le(self.timeout);
27925 __tmp.put_u8(self.device as u8);
27926 __tmp.put_u8(self.flags.bits());
27927 __tmp.put_u8(self.count);
27928 for val in &self.data {
27929 __tmp.put_u8(*val);
27930 }
27931 if matches!(version, MavlinkVersion::V2) {
27932 __tmp.put_u8(self.target_system);
27933 __tmp.put_u8(self.target_component);
27934 let len = __tmp.len();
27935 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27936 } else {
27937 __tmp.len()
27938 }
27939 }
27940}
27941#[doc = "Superseded by ACTUATOR_OUTPUT_STATUS. The RAW values of the servo outputs (for RC input from the remote, use the RC_CHANNELS messages). The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%."]
27942#[doc = ""]
27943#[doc = "ID: 36"]
27944#[derive(Debug, Clone, PartialEq)]
27945#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27946#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27947#[cfg_attr(feature = "ts", derive(TS))]
27948#[cfg_attr(feature = "ts", ts(export))]
27949pub struct SERVO_OUTPUT_RAW_DATA {
27950 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
27951 pub time_usec: u32,
27952 #[doc = "Servo output 1 value"]
27953 pub servo1_raw: u16,
27954 #[doc = "Servo output 2 value"]
27955 pub servo2_raw: u16,
27956 #[doc = "Servo output 3 value"]
27957 pub servo3_raw: u16,
27958 #[doc = "Servo output 4 value"]
27959 pub servo4_raw: u16,
27960 #[doc = "Servo output 5 value"]
27961 pub servo5_raw: u16,
27962 #[doc = "Servo output 6 value"]
27963 pub servo6_raw: u16,
27964 #[doc = "Servo output 7 value"]
27965 pub servo7_raw: u16,
27966 #[doc = "Servo output 8 value"]
27967 pub servo8_raw: u16,
27968 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
27969 pub port: u8,
27970 #[doc = "Servo output 9 value"]
27971 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27972 pub servo9_raw: u16,
27973 #[doc = "Servo output 10 value"]
27974 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27975 pub servo10_raw: u16,
27976 #[doc = "Servo output 11 value"]
27977 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27978 pub servo11_raw: u16,
27979 #[doc = "Servo output 12 value"]
27980 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27981 pub servo12_raw: u16,
27982 #[doc = "Servo output 13 value"]
27983 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27984 pub servo13_raw: u16,
27985 #[doc = "Servo output 14 value"]
27986 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27987 pub servo14_raw: u16,
27988 #[doc = "Servo output 15 value"]
27989 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27990 pub servo15_raw: u16,
27991 #[doc = "Servo output 16 value"]
27992 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27993 pub servo16_raw: u16,
27994}
27995impl SERVO_OUTPUT_RAW_DATA {
27996 pub const ENCODED_LEN: usize = 37usize;
27997 pub const DEFAULT: Self = Self {
27998 time_usec: 0_u32,
27999 servo1_raw: 0_u16,
28000 servo2_raw: 0_u16,
28001 servo3_raw: 0_u16,
28002 servo4_raw: 0_u16,
28003 servo5_raw: 0_u16,
28004 servo6_raw: 0_u16,
28005 servo7_raw: 0_u16,
28006 servo8_raw: 0_u16,
28007 port: 0_u8,
28008 servo9_raw: 0_u16,
28009 servo10_raw: 0_u16,
28010 servo11_raw: 0_u16,
28011 servo12_raw: 0_u16,
28012 servo13_raw: 0_u16,
28013 servo14_raw: 0_u16,
28014 servo15_raw: 0_u16,
28015 servo16_raw: 0_u16,
28016 };
28017 #[cfg(feature = "arbitrary")]
28018 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28019 use arbitrary::{Arbitrary, Unstructured};
28020 let mut buf = [0u8; 1024];
28021 rng.fill_bytes(&mut buf);
28022 let mut unstructured = Unstructured::new(&buf);
28023 Self::arbitrary(&mut unstructured).unwrap_or_default()
28024 }
28025}
28026impl Default for SERVO_OUTPUT_RAW_DATA {
28027 fn default() -> Self {
28028 Self::DEFAULT.clone()
28029 }
28030}
28031impl MessageData for SERVO_OUTPUT_RAW_DATA {
28032 type Message = MavMessage;
28033 const ID: u32 = 36u32;
28034 const NAME: &'static str = "SERVO_OUTPUT_RAW";
28035 const EXTRA_CRC: u8 = 222u8;
28036 const ENCODED_LEN: usize = 37usize;
28037 fn deser(
28038 _version: MavlinkVersion,
28039 __input: &[u8],
28040 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28041 let avail_len = __input.len();
28042 let mut payload_buf = [0; Self::ENCODED_LEN];
28043 let mut buf = if avail_len < Self::ENCODED_LEN {
28044 payload_buf[0..avail_len].copy_from_slice(__input);
28045 Bytes::new(&payload_buf)
28046 } else {
28047 Bytes::new(__input)
28048 };
28049 let mut __struct = Self::default();
28050 __struct.time_usec = buf.get_u32_le();
28051 __struct.servo1_raw = buf.get_u16_le();
28052 __struct.servo2_raw = buf.get_u16_le();
28053 __struct.servo3_raw = buf.get_u16_le();
28054 __struct.servo4_raw = buf.get_u16_le();
28055 __struct.servo5_raw = buf.get_u16_le();
28056 __struct.servo6_raw = buf.get_u16_le();
28057 __struct.servo7_raw = buf.get_u16_le();
28058 __struct.servo8_raw = buf.get_u16_le();
28059 __struct.port = buf.get_u8();
28060 __struct.servo9_raw = buf.get_u16_le();
28061 __struct.servo10_raw = buf.get_u16_le();
28062 __struct.servo11_raw = buf.get_u16_le();
28063 __struct.servo12_raw = buf.get_u16_le();
28064 __struct.servo13_raw = buf.get_u16_le();
28065 __struct.servo14_raw = buf.get_u16_le();
28066 __struct.servo15_raw = buf.get_u16_le();
28067 __struct.servo16_raw = buf.get_u16_le();
28068 Ok(__struct)
28069 }
28070 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28071 let mut __tmp = BytesMut::new(bytes);
28072 #[allow(clippy::absurd_extreme_comparisons)]
28073 #[allow(unused_comparisons)]
28074 if __tmp.remaining() < Self::ENCODED_LEN {
28075 panic!(
28076 "buffer is too small (need {} bytes, but got {})",
28077 Self::ENCODED_LEN,
28078 __tmp.remaining(),
28079 )
28080 }
28081 __tmp.put_u32_le(self.time_usec);
28082 __tmp.put_u16_le(self.servo1_raw);
28083 __tmp.put_u16_le(self.servo2_raw);
28084 __tmp.put_u16_le(self.servo3_raw);
28085 __tmp.put_u16_le(self.servo4_raw);
28086 __tmp.put_u16_le(self.servo5_raw);
28087 __tmp.put_u16_le(self.servo6_raw);
28088 __tmp.put_u16_le(self.servo7_raw);
28089 __tmp.put_u16_le(self.servo8_raw);
28090 __tmp.put_u8(self.port);
28091 if matches!(version, MavlinkVersion::V2) {
28092 __tmp.put_u16_le(self.servo9_raw);
28093 __tmp.put_u16_le(self.servo10_raw);
28094 __tmp.put_u16_le(self.servo11_raw);
28095 __tmp.put_u16_le(self.servo12_raw);
28096 __tmp.put_u16_le(self.servo13_raw);
28097 __tmp.put_u16_le(self.servo14_raw);
28098 __tmp.put_u16_le(self.servo15_raw);
28099 __tmp.put_u16_le(self.servo16_raw);
28100 let len = __tmp.len();
28101 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28102 } else {
28103 __tmp.len()
28104 }
28105 }
28106}
28107#[doc = "Setup a MAVLink2 signing key. If called with secret_key of all zero and zero initial_timestamp will disable signing."]
28108#[doc = ""]
28109#[doc = "ID: 256"]
28110#[derive(Debug, Clone, PartialEq)]
28111#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28112#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28113#[cfg_attr(feature = "ts", derive(TS))]
28114#[cfg_attr(feature = "ts", ts(export))]
28115pub struct SETUP_SIGNING_DATA {
28116 #[doc = "initial timestamp"]
28117 pub initial_timestamp: u64,
28118 #[doc = "system id of the target"]
28119 pub target_system: u8,
28120 #[doc = "component ID of the target"]
28121 pub target_component: u8,
28122 #[doc = "signing key"]
28123 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28124 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
28125 pub secret_key: [u8; 32],
28126}
28127impl SETUP_SIGNING_DATA {
28128 pub const ENCODED_LEN: usize = 42usize;
28129 pub const DEFAULT: Self = Self {
28130 initial_timestamp: 0_u64,
28131 target_system: 0_u8,
28132 target_component: 0_u8,
28133 secret_key: [0_u8; 32usize],
28134 };
28135 #[cfg(feature = "arbitrary")]
28136 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28137 use arbitrary::{Arbitrary, Unstructured};
28138 let mut buf = [0u8; 1024];
28139 rng.fill_bytes(&mut buf);
28140 let mut unstructured = Unstructured::new(&buf);
28141 Self::arbitrary(&mut unstructured).unwrap_or_default()
28142 }
28143}
28144impl Default for SETUP_SIGNING_DATA {
28145 fn default() -> Self {
28146 Self::DEFAULT.clone()
28147 }
28148}
28149impl MessageData for SETUP_SIGNING_DATA {
28150 type Message = MavMessage;
28151 const ID: u32 = 256u32;
28152 const NAME: &'static str = "SETUP_SIGNING";
28153 const EXTRA_CRC: u8 = 71u8;
28154 const ENCODED_LEN: usize = 42usize;
28155 fn deser(
28156 _version: MavlinkVersion,
28157 __input: &[u8],
28158 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28159 let avail_len = __input.len();
28160 let mut payload_buf = [0; Self::ENCODED_LEN];
28161 let mut buf = if avail_len < Self::ENCODED_LEN {
28162 payload_buf[0..avail_len].copy_from_slice(__input);
28163 Bytes::new(&payload_buf)
28164 } else {
28165 Bytes::new(__input)
28166 };
28167 let mut __struct = Self::default();
28168 __struct.initial_timestamp = buf.get_u64_le();
28169 __struct.target_system = buf.get_u8();
28170 __struct.target_component = buf.get_u8();
28171 for v in &mut __struct.secret_key {
28172 let val = buf.get_u8();
28173 *v = val;
28174 }
28175 Ok(__struct)
28176 }
28177 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28178 let mut __tmp = BytesMut::new(bytes);
28179 #[allow(clippy::absurd_extreme_comparisons)]
28180 #[allow(unused_comparisons)]
28181 if __tmp.remaining() < Self::ENCODED_LEN {
28182 panic!(
28183 "buffer is too small (need {} bytes, but got {})",
28184 Self::ENCODED_LEN,
28185 __tmp.remaining(),
28186 )
28187 }
28188 __tmp.put_u64_le(self.initial_timestamp);
28189 __tmp.put_u8(self.target_system);
28190 __tmp.put_u8(self.target_component);
28191 for val in &self.secret_key {
28192 __tmp.put_u8(*val);
28193 }
28194 if matches!(version, MavlinkVersion::V2) {
28195 let len = __tmp.len();
28196 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28197 } else {
28198 __tmp.len()
28199 }
28200 }
28201}
28202#[doc = "Set the vehicle attitude and body angular rates."]
28203#[doc = ""]
28204#[doc = "ID: 139"]
28205#[derive(Debug, Clone, PartialEq)]
28206#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28207#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28208#[cfg_attr(feature = "ts", derive(TS))]
28209#[cfg_attr(feature = "ts", ts(export))]
28210pub struct SET_ACTUATOR_CONTROL_TARGET_DATA {
28211 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
28212 pub time_usec: u64,
28213 #[doc = "Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs."]
28214 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28215 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
28216 pub controls: [f32; 8],
28217 #[doc = "Actuator group. The \"_mlx\" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances."]
28218 pub group_mlx: u8,
28219 #[doc = "System ID"]
28220 pub target_system: u8,
28221 #[doc = "Component ID"]
28222 pub target_component: u8,
28223}
28224impl SET_ACTUATOR_CONTROL_TARGET_DATA {
28225 pub const ENCODED_LEN: usize = 43usize;
28226 pub const DEFAULT: Self = Self {
28227 time_usec: 0_u64,
28228 controls: [0.0_f32; 8usize],
28229 group_mlx: 0_u8,
28230 target_system: 0_u8,
28231 target_component: 0_u8,
28232 };
28233 #[cfg(feature = "arbitrary")]
28234 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28235 use arbitrary::{Arbitrary, Unstructured};
28236 let mut buf = [0u8; 1024];
28237 rng.fill_bytes(&mut buf);
28238 let mut unstructured = Unstructured::new(&buf);
28239 Self::arbitrary(&mut unstructured).unwrap_or_default()
28240 }
28241}
28242impl Default for SET_ACTUATOR_CONTROL_TARGET_DATA {
28243 fn default() -> Self {
28244 Self::DEFAULT.clone()
28245 }
28246}
28247impl MessageData for SET_ACTUATOR_CONTROL_TARGET_DATA {
28248 type Message = MavMessage;
28249 const ID: u32 = 139u32;
28250 const NAME: &'static str = "SET_ACTUATOR_CONTROL_TARGET";
28251 const EXTRA_CRC: u8 = 168u8;
28252 const ENCODED_LEN: usize = 43usize;
28253 fn deser(
28254 _version: MavlinkVersion,
28255 __input: &[u8],
28256 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28257 let avail_len = __input.len();
28258 let mut payload_buf = [0; Self::ENCODED_LEN];
28259 let mut buf = if avail_len < Self::ENCODED_LEN {
28260 payload_buf[0..avail_len].copy_from_slice(__input);
28261 Bytes::new(&payload_buf)
28262 } else {
28263 Bytes::new(__input)
28264 };
28265 let mut __struct = Self::default();
28266 __struct.time_usec = buf.get_u64_le();
28267 for v in &mut __struct.controls {
28268 let val = buf.get_f32_le();
28269 *v = val;
28270 }
28271 __struct.group_mlx = buf.get_u8();
28272 __struct.target_system = buf.get_u8();
28273 __struct.target_component = buf.get_u8();
28274 Ok(__struct)
28275 }
28276 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28277 let mut __tmp = BytesMut::new(bytes);
28278 #[allow(clippy::absurd_extreme_comparisons)]
28279 #[allow(unused_comparisons)]
28280 if __tmp.remaining() < Self::ENCODED_LEN {
28281 panic!(
28282 "buffer is too small (need {} bytes, but got {})",
28283 Self::ENCODED_LEN,
28284 __tmp.remaining(),
28285 )
28286 }
28287 __tmp.put_u64_le(self.time_usec);
28288 for val in &self.controls {
28289 __tmp.put_f32_le(*val);
28290 }
28291 __tmp.put_u8(self.group_mlx);
28292 __tmp.put_u8(self.target_system);
28293 __tmp.put_u8(self.target_component);
28294 if matches!(version, MavlinkVersion::V2) {
28295 let len = __tmp.len();
28296 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28297 } else {
28298 __tmp.len()
28299 }
28300 }
28301}
28302#[doc = "Sets a desired vehicle attitude. Used by an external controller to command the vehicle (manual controller or other system)."]
28303#[doc = ""]
28304#[doc = "ID: 82"]
28305#[derive(Debug, Clone, PartialEq)]
28306#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28307#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28308#[cfg_attr(feature = "ts", derive(TS))]
28309#[cfg_attr(feature = "ts", ts(export))]
28310pub struct SET_ATTITUDE_TARGET_DATA {
28311 #[doc = "Timestamp (time since system boot)."]
28312 pub time_boot_ms: u32,
28313 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) from MAV_FRAME_LOCAL_NED to MAV_FRAME_BODY_FRD"]
28314 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28315 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
28316 pub q: [f32; 4],
28317 #[doc = "Body roll rate"]
28318 pub body_roll_rate: f32,
28319 #[doc = "Body pitch rate"]
28320 pub body_pitch_rate: f32,
28321 #[doc = "Body yaw rate"]
28322 pub body_yaw_rate: f32,
28323 #[doc = "Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)"]
28324 pub thrust: f32,
28325 #[doc = "System ID"]
28326 pub target_system: u8,
28327 #[doc = "Component ID"]
28328 pub target_component: u8,
28329 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
28330 pub type_mask: AttitudeTargetTypemask,
28331 #[doc = "3D thrust setpoint in the body NED frame, normalized to -1 .. 1"]
28332 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28333 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28334 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
28335 pub thrust_body: [f32; 3],
28336}
28337impl SET_ATTITUDE_TARGET_DATA {
28338 pub const ENCODED_LEN: usize = 51usize;
28339 pub const DEFAULT: Self = Self {
28340 time_boot_ms: 0_u32,
28341 q: [0.0_f32; 4usize],
28342 body_roll_rate: 0.0_f32,
28343 body_pitch_rate: 0.0_f32,
28344 body_yaw_rate: 0.0_f32,
28345 thrust: 0.0_f32,
28346 target_system: 0_u8,
28347 target_component: 0_u8,
28348 type_mask: AttitudeTargetTypemask::DEFAULT,
28349 thrust_body: [0.0_f32; 3usize],
28350 };
28351 #[cfg(feature = "arbitrary")]
28352 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28353 use arbitrary::{Arbitrary, Unstructured};
28354 let mut buf = [0u8; 1024];
28355 rng.fill_bytes(&mut buf);
28356 let mut unstructured = Unstructured::new(&buf);
28357 Self::arbitrary(&mut unstructured).unwrap_or_default()
28358 }
28359}
28360impl Default for SET_ATTITUDE_TARGET_DATA {
28361 fn default() -> Self {
28362 Self::DEFAULT.clone()
28363 }
28364}
28365impl MessageData for SET_ATTITUDE_TARGET_DATA {
28366 type Message = MavMessage;
28367 const ID: u32 = 82u32;
28368 const NAME: &'static str = "SET_ATTITUDE_TARGET";
28369 const EXTRA_CRC: u8 = 49u8;
28370 const ENCODED_LEN: usize = 51usize;
28371 fn deser(
28372 _version: MavlinkVersion,
28373 __input: &[u8],
28374 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28375 let avail_len = __input.len();
28376 let mut payload_buf = [0; Self::ENCODED_LEN];
28377 let mut buf = if avail_len < Self::ENCODED_LEN {
28378 payload_buf[0..avail_len].copy_from_slice(__input);
28379 Bytes::new(&payload_buf)
28380 } else {
28381 Bytes::new(__input)
28382 };
28383 let mut __struct = Self::default();
28384 __struct.time_boot_ms = buf.get_u32_le();
28385 for v in &mut __struct.q {
28386 let val = buf.get_f32_le();
28387 *v = val;
28388 }
28389 __struct.body_roll_rate = buf.get_f32_le();
28390 __struct.body_pitch_rate = buf.get_f32_le();
28391 __struct.body_yaw_rate = buf.get_f32_le();
28392 __struct.thrust = buf.get_f32_le();
28393 __struct.target_system = buf.get_u8();
28394 __struct.target_component = buf.get_u8();
28395 let tmp = buf.get_u8();
28396 __struct.type_mask = AttitudeTargetTypemask::from_bits(
28397 tmp & AttitudeTargetTypemask::all().bits(),
28398 )
28399 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28400 flag_type: "AttitudeTargetTypemask",
28401 value: tmp as u32,
28402 })?;
28403 for v in &mut __struct.thrust_body {
28404 let val = buf.get_f32_le();
28405 *v = val;
28406 }
28407 Ok(__struct)
28408 }
28409 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28410 let mut __tmp = BytesMut::new(bytes);
28411 #[allow(clippy::absurd_extreme_comparisons)]
28412 #[allow(unused_comparisons)]
28413 if __tmp.remaining() < Self::ENCODED_LEN {
28414 panic!(
28415 "buffer is too small (need {} bytes, but got {})",
28416 Self::ENCODED_LEN,
28417 __tmp.remaining(),
28418 )
28419 }
28420 __tmp.put_u32_le(self.time_boot_ms);
28421 for val in &self.q {
28422 __tmp.put_f32_le(*val);
28423 }
28424 __tmp.put_f32_le(self.body_roll_rate);
28425 __tmp.put_f32_le(self.body_pitch_rate);
28426 __tmp.put_f32_le(self.body_yaw_rate);
28427 __tmp.put_f32_le(self.thrust);
28428 __tmp.put_u8(self.target_system);
28429 __tmp.put_u8(self.target_component);
28430 __tmp.put_u8(self.type_mask.bits());
28431 if matches!(version, MavlinkVersion::V2) {
28432 for val in &self.thrust_body {
28433 __tmp.put_f32_le(*val);
28434 }
28435 let len = __tmp.len();
28436 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28437 } else {
28438 __tmp.len()
28439 }
28440 }
28441}
28442#[deprecated = " See `MAV_CMD_SET_GLOBAL_ORIGIN` (Deprecated since 2025-04)"]
28443#[doc = "Sets the GPS coordinates of the vehicle local origin (0,0,0) position. Vehicle should emit GPS_GLOBAL_ORIGIN irrespective of whether the origin is changed. This enables transform between the local coordinate frame and the global (GPS) coordinate frame, which may be necessary when (for example) indoor and outdoor settings are connected and the MAV should move from in- to outdoor."]
28444#[doc = ""]
28445#[doc = "ID: 48"]
28446#[derive(Debug, Clone, PartialEq)]
28447#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28448#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28449#[cfg_attr(feature = "ts", derive(TS))]
28450#[cfg_attr(feature = "ts", ts(export))]
28451pub struct SET_GPS_GLOBAL_ORIGIN_DATA {
28452 #[doc = "Latitude (WGS84)"]
28453 pub latitude: i32,
28454 #[doc = "Longitude (WGS84)"]
28455 pub longitude: i32,
28456 #[doc = "Altitude (MSL). Positive for up."]
28457 pub altitude: i32,
28458 #[doc = "System ID"]
28459 pub target_system: u8,
28460 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
28461 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28462 pub time_usec: u64,
28463}
28464impl SET_GPS_GLOBAL_ORIGIN_DATA {
28465 pub const ENCODED_LEN: usize = 21usize;
28466 pub const DEFAULT: Self = Self {
28467 latitude: 0_i32,
28468 longitude: 0_i32,
28469 altitude: 0_i32,
28470 target_system: 0_u8,
28471 time_usec: 0_u64,
28472 };
28473 #[cfg(feature = "arbitrary")]
28474 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28475 use arbitrary::{Arbitrary, Unstructured};
28476 let mut buf = [0u8; 1024];
28477 rng.fill_bytes(&mut buf);
28478 let mut unstructured = Unstructured::new(&buf);
28479 Self::arbitrary(&mut unstructured).unwrap_or_default()
28480 }
28481}
28482impl Default for SET_GPS_GLOBAL_ORIGIN_DATA {
28483 fn default() -> Self {
28484 Self::DEFAULT.clone()
28485 }
28486}
28487impl MessageData for SET_GPS_GLOBAL_ORIGIN_DATA {
28488 type Message = MavMessage;
28489 const ID: u32 = 48u32;
28490 const NAME: &'static str = "SET_GPS_GLOBAL_ORIGIN";
28491 const EXTRA_CRC: u8 = 41u8;
28492 const ENCODED_LEN: usize = 21usize;
28493 fn deser(
28494 _version: MavlinkVersion,
28495 __input: &[u8],
28496 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28497 let avail_len = __input.len();
28498 let mut payload_buf = [0; Self::ENCODED_LEN];
28499 let mut buf = if avail_len < Self::ENCODED_LEN {
28500 payload_buf[0..avail_len].copy_from_slice(__input);
28501 Bytes::new(&payload_buf)
28502 } else {
28503 Bytes::new(__input)
28504 };
28505 let mut __struct = Self::default();
28506 __struct.latitude = buf.get_i32_le();
28507 __struct.longitude = buf.get_i32_le();
28508 __struct.altitude = buf.get_i32_le();
28509 __struct.target_system = buf.get_u8();
28510 __struct.time_usec = buf.get_u64_le();
28511 Ok(__struct)
28512 }
28513 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28514 let mut __tmp = BytesMut::new(bytes);
28515 #[allow(clippy::absurd_extreme_comparisons)]
28516 #[allow(unused_comparisons)]
28517 if __tmp.remaining() < Self::ENCODED_LEN {
28518 panic!(
28519 "buffer is too small (need {} bytes, but got {})",
28520 Self::ENCODED_LEN,
28521 __tmp.remaining(),
28522 )
28523 }
28524 __tmp.put_i32_le(self.latitude);
28525 __tmp.put_i32_le(self.longitude);
28526 __tmp.put_i32_le(self.altitude);
28527 __tmp.put_u8(self.target_system);
28528 if matches!(version, MavlinkVersion::V2) {
28529 __tmp.put_u64_le(self.time_usec);
28530 let len = __tmp.len();
28531 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28532 } else {
28533 __tmp.len()
28534 }
28535 }
28536}
28537#[deprecated = "The command protocol version (MAV_CMD_DO_SET_HOME) allows a GCS to detect when setting the home position has failed. See `MAV_CMD_DO_SET_HOME` (Deprecated since 2022-02)"]
28538#[doc = "Sets the home position. \tThe home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this message). The global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. Under normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. The approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
28539#[doc = ""]
28540#[doc = "ID: 243"]
28541#[derive(Debug, Clone, PartialEq)]
28542#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28543#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28544#[cfg_attr(feature = "ts", derive(TS))]
28545#[cfg_attr(feature = "ts", ts(export))]
28546pub struct SET_HOME_POSITION_DATA {
28547 #[doc = "Latitude (WGS84)"]
28548 pub latitude: i32,
28549 #[doc = "Longitude (WGS84)"]
28550 pub longitude: i32,
28551 #[doc = "Altitude (MSL). Positive for up."]
28552 pub altitude: i32,
28553 #[doc = "Local X position of this position in the local coordinate frame (NED)"]
28554 pub x: f32,
28555 #[doc = "Local Y position of this position in the local coordinate frame (NED)"]
28556 pub y: f32,
28557 #[doc = "Local Z position of this position in the local coordinate frame (NED: positive \"down\")"]
28558 pub z: f32,
28559 #[doc = "World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground"]
28560 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28561 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
28562 pub q: [f32; 4],
28563 #[doc = "Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
28564 pub approach_x: f32,
28565 #[doc = "Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
28566 pub approach_y: f32,
28567 #[doc = "Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
28568 pub approach_z: f32,
28569 #[doc = "System ID."]
28570 pub target_system: u8,
28571 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
28572 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28573 pub time_usec: u64,
28574}
28575impl SET_HOME_POSITION_DATA {
28576 pub const ENCODED_LEN: usize = 61usize;
28577 pub const DEFAULT: Self = Self {
28578 latitude: 0_i32,
28579 longitude: 0_i32,
28580 altitude: 0_i32,
28581 x: 0.0_f32,
28582 y: 0.0_f32,
28583 z: 0.0_f32,
28584 q: [0.0_f32; 4usize],
28585 approach_x: 0.0_f32,
28586 approach_y: 0.0_f32,
28587 approach_z: 0.0_f32,
28588 target_system: 0_u8,
28589 time_usec: 0_u64,
28590 };
28591 #[cfg(feature = "arbitrary")]
28592 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28593 use arbitrary::{Arbitrary, Unstructured};
28594 let mut buf = [0u8; 1024];
28595 rng.fill_bytes(&mut buf);
28596 let mut unstructured = Unstructured::new(&buf);
28597 Self::arbitrary(&mut unstructured).unwrap_or_default()
28598 }
28599}
28600impl Default for SET_HOME_POSITION_DATA {
28601 fn default() -> Self {
28602 Self::DEFAULT.clone()
28603 }
28604}
28605impl MessageData for SET_HOME_POSITION_DATA {
28606 type Message = MavMessage;
28607 const ID: u32 = 243u32;
28608 const NAME: &'static str = "SET_HOME_POSITION";
28609 const EXTRA_CRC: u8 = 85u8;
28610 const ENCODED_LEN: usize = 61usize;
28611 fn deser(
28612 _version: MavlinkVersion,
28613 __input: &[u8],
28614 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28615 let avail_len = __input.len();
28616 let mut payload_buf = [0; Self::ENCODED_LEN];
28617 let mut buf = if avail_len < Self::ENCODED_LEN {
28618 payload_buf[0..avail_len].copy_from_slice(__input);
28619 Bytes::new(&payload_buf)
28620 } else {
28621 Bytes::new(__input)
28622 };
28623 let mut __struct = Self::default();
28624 __struct.latitude = buf.get_i32_le();
28625 __struct.longitude = buf.get_i32_le();
28626 __struct.altitude = buf.get_i32_le();
28627 __struct.x = buf.get_f32_le();
28628 __struct.y = buf.get_f32_le();
28629 __struct.z = buf.get_f32_le();
28630 for v in &mut __struct.q {
28631 let val = buf.get_f32_le();
28632 *v = val;
28633 }
28634 __struct.approach_x = buf.get_f32_le();
28635 __struct.approach_y = buf.get_f32_le();
28636 __struct.approach_z = buf.get_f32_le();
28637 __struct.target_system = buf.get_u8();
28638 __struct.time_usec = buf.get_u64_le();
28639 Ok(__struct)
28640 }
28641 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28642 let mut __tmp = BytesMut::new(bytes);
28643 #[allow(clippy::absurd_extreme_comparisons)]
28644 #[allow(unused_comparisons)]
28645 if __tmp.remaining() < Self::ENCODED_LEN {
28646 panic!(
28647 "buffer is too small (need {} bytes, but got {})",
28648 Self::ENCODED_LEN,
28649 __tmp.remaining(),
28650 )
28651 }
28652 __tmp.put_i32_le(self.latitude);
28653 __tmp.put_i32_le(self.longitude);
28654 __tmp.put_i32_le(self.altitude);
28655 __tmp.put_f32_le(self.x);
28656 __tmp.put_f32_le(self.y);
28657 __tmp.put_f32_le(self.z);
28658 for val in &self.q {
28659 __tmp.put_f32_le(*val);
28660 }
28661 __tmp.put_f32_le(self.approach_x);
28662 __tmp.put_f32_le(self.approach_y);
28663 __tmp.put_f32_le(self.approach_z);
28664 __tmp.put_u8(self.target_system);
28665 if matches!(version, MavlinkVersion::V2) {
28666 __tmp.put_u64_le(self.time_usec);
28667 let len = __tmp.len();
28668 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28669 } else {
28670 __tmp.len()
28671 }
28672 }
28673}
28674#[deprecated = "Use COMMAND_LONG with MAV_CMD_DO_SET_MODE instead. See `MAV_CMD_DO_SET_MODE` (Deprecated since 2015-12)"]
28675#[doc = "Set the system mode, as defined by enum MAV_MODE. There is no target component id as the mode is by definition for the overall aircraft, not only for one component."]
28676#[doc = ""]
28677#[doc = "ID: 11"]
28678#[derive(Debug, Clone, PartialEq)]
28679#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28680#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28681#[cfg_attr(feature = "ts", derive(TS))]
28682#[cfg_attr(feature = "ts", ts(export))]
28683pub struct SET_MODE_DATA {
28684 #[doc = "The new autopilot-specific mode. This field can be ignored by an autopilot."]
28685 pub custom_mode: u32,
28686 #[doc = "The system setting the mode"]
28687 pub target_system: u8,
28688 #[doc = "The new base mode."]
28689 pub base_mode: MavMode,
28690}
28691impl SET_MODE_DATA {
28692 pub const ENCODED_LEN: usize = 6usize;
28693 pub const DEFAULT: Self = Self {
28694 custom_mode: 0_u32,
28695 target_system: 0_u8,
28696 base_mode: MavMode::DEFAULT,
28697 };
28698 #[cfg(feature = "arbitrary")]
28699 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28700 use arbitrary::{Arbitrary, Unstructured};
28701 let mut buf = [0u8; 1024];
28702 rng.fill_bytes(&mut buf);
28703 let mut unstructured = Unstructured::new(&buf);
28704 Self::arbitrary(&mut unstructured).unwrap_or_default()
28705 }
28706}
28707impl Default for SET_MODE_DATA {
28708 fn default() -> Self {
28709 Self::DEFAULT.clone()
28710 }
28711}
28712impl MessageData for SET_MODE_DATA {
28713 type Message = MavMessage;
28714 const ID: u32 = 11u32;
28715 const NAME: &'static str = "SET_MODE";
28716 const EXTRA_CRC: u8 = 89u8;
28717 const ENCODED_LEN: usize = 6usize;
28718 fn deser(
28719 _version: MavlinkVersion,
28720 __input: &[u8],
28721 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28722 let avail_len = __input.len();
28723 let mut payload_buf = [0; Self::ENCODED_LEN];
28724 let mut buf = if avail_len < Self::ENCODED_LEN {
28725 payload_buf[0..avail_len].copy_from_slice(__input);
28726 Bytes::new(&payload_buf)
28727 } else {
28728 Bytes::new(__input)
28729 };
28730 let mut __struct = Self::default();
28731 __struct.custom_mode = buf.get_u32_le();
28732 __struct.target_system = buf.get_u8();
28733 let tmp = buf.get_u8();
28734 __struct.base_mode =
28735 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28736 enum_type: "MavMode",
28737 value: tmp as u32,
28738 })?;
28739 Ok(__struct)
28740 }
28741 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28742 let mut __tmp = BytesMut::new(bytes);
28743 #[allow(clippy::absurd_extreme_comparisons)]
28744 #[allow(unused_comparisons)]
28745 if __tmp.remaining() < Self::ENCODED_LEN {
28746 panic!(
28747 "buffer is too small (need {} bytes, but got {})",
28748 Self::ENCODED_LEN,
28749 __tmp.remaining(),
28750 )
28751 }
28752 __tmp.put_u32_le(self.custom_mode);
28753 __tmp.put_u8(self.target_system);
28754 __tmp.put_u8(self.base_mode as u8);
28755 if matches!(version, MavlinkVersion::V2) {
28756 let len = __tmp.len();
28757 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28758 } else {
28759 __tmp.len()
28760 }
28761 }
28762}
28763#[doc = "Sets a desired vehicle position, velocity, and/or acceleration in a global coordinate system (WGS84). Used by an external controller to command the vehicle (manual controller or other system)."]
28764#[doc = ""]
28765#[doc = "ID: 86"]
28766#[derive(Debug, Clone, PartialEq)]
28767#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28768#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28769#[cfg_attr(feature = "ts", derive(TS))]
28770#[cfg_attr(feature = "ts", ts(export))]
28771pub struct SET_POSITION_TARGET_GLOBAL_INT_DATA {
28772 #[doc = "Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency."]
28773 pub time_boot_ms: u32,
28774 #[doc = "Latitude in WGS84 frame"]
28775 pub lat_int: i32,
28776 #[doc = "Longitude in WGS84 frame"]
28777 pub lon_int: i32,
28778 #[doc = "Altitude (MSL, Relative to home, or AGL - depending on frame)"]
28779 pub alt: f32,
28780 #[doc = "X velocity in NED frame"]
28781 pub vx: f32,
28782 #[doc = "Y velocity in NED frame"]
28783 pub vy: f32,
28784 #[doc = "Z velocity in NED frame"]
28785 pub vz: f32,
28786 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28787 pub afx: f32,
28788 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28789 pub afy: f32,
28790 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28791 pub afz: f32,
28792 #[doc = "yaw setpoint"]
28793 pub yaw: f32,
28794 #[doc = "yaw rate setpoint"]
28795 pub yaw_rate: f32,
28796 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
28797 pub type_mask: PositionTargetTypemask,
28798 #[doc = "System ID"]
28799 pub target_system: u8,
28800 #[doc = "Component ID"]
28801 pub target_component: u8,
28802 #[doc = "Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)"]
28803 pub coordinate_frame: MavFrame,
28804}
28805impl SET_POSITION_TARGET_GLOBAL_INT_DATA {
28806 pub const ENCODED_LEN: usize = 53usize;
28807 pub const DEFAULT: Self = Self {
28808 time_boot_ms: 0_u32,
28809 lat_int: 0_i32,
28810 lon_int: 0_i32,
28811 alt: 0.0_f32,
28812 vx: 0.0_f32,
28813 vy: 0.0_f32,
28814 vz: 0.0_f32,
28815 afx: 0.0_f32,
28816 afy: 0.0_f32,
28817 afz: 0.0_f32,
28818 yaw: 0.0_f32,
28819 yaw_rate: 0.0_f32,
28820 type_mask: PositionTargetTypemask::DEFAULT,
28821 target_system: 0_u8,
28822 target_component: 0_u8,
28823 coordinate_frame: MavFrame::DEFAULT,
28824 };
28825 #[cfg(feature = "arbitrary")]
28826 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28827 use arbitrary::{Arbitrary, Unstructured};
28828 let mut buf = [0u8; 1024];
28829 rng.fill_bytes(&mut buf);
28830 let mut unstructured = Unstructured::new(&buf);
28831 Self::arbitrary(&mut unstructured).unwrap_or_default()
28832 }
28833}
28834impl Default for SET_POSITION_TARGET_GLOBAL_INT_DATA {
28835 fn default() -> Self {
28836 Self::DEFAULT.clone()
28837 }
28838}
28839impl MessageData for SET_POSITION_TARGET_GLOBAL_INT_DATA {
28840 type Message = MavMessage;
28841 const ID: u32 = 86u32;
28842 const NAME: &'static str = "SET_POSITION_TARGET_GLOBAL_INT";
28843 const EXTRA_CRC: u8 = 5u8;
28844 const ENCODED_LEN: usize = 53usize;
28845 fn deser(
28846 _version: MavlinkVersion,
28847 __input: &[u8],
28848 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28849 let avail_len = __input.len();
28850 let mut payload_buf = [0; Self::ENCODED_LEN];
28851 let mut buf = if avail_len < Self::ENCODED_LEN {
28852 payload_buf[0..avail_len].copy_from_slice(__input);
28853 Bytes::new(&payload_buf)
28854 } else {
28855 Bytes::new(__input)
28856 };
28857 let mut __struct = Self::default();
28858 __struct.time_boot_ms = buf.get_u32_le();
28859 __struct.lat_int = buf.get_i32_le();
28860 __struct.lon_int = buf.get_i32_le();
28861 __struct.alt = buf.get_f32_le();
28862 __struct.vx = buf.get_f32_le();
28863 __struct.vy = buf.get_f32_le();
28864 __struct.vz = buf.get_f32_le();
28865 __struct.afx = buf.get_f32_le();
28866 __struct.afy = buf.get_f32_le();
28867 __struct.afz = buf.get_f32_le();
28868 __struct.yaw = buf.get_f32_le();
28869 __struct.yaw_rate = buf.get_f32_le();
28870 let tmp = buf.get_u16_le();
28871 __struct.type_mask = PositionTargetTypemask::from_bits(
28872 tmp & PositionTargetTypemask::all().bits(),
28873 )
28874 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28875 flag_type: "PositionTargetTypemask",
28876 value: tmp as u32,
28877 })?;
28878 __struct.target_system = buf.get_u8();
28879 __struct.target_component = buf.get_u8();
28880 let tmp = buf.get_u8();
28881 __struct.coordinate_frame =
28882 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28883 enum_type: "MavFrame",
28884 value: tmp as u32,
28885 })?;
28886 Ok(__struct)
28887 }
28888 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28889 let mut __tmp = BytesMut::new(bytes);
28890 #[allow(clippy::absurd_extreme_comparisons)]
28891 #[allow(unused_comparisons)]
28892 if __tmp.remaining() < Self::ENCODED_LEN {
28893 panic!(
28894 "buffer is too small (need {} bytes, but got {})",
28895 Self::ENCODED_LEN,
28896 __tmp.remaining(),
28897 )
28898 }
28899 __tmp.put_u32_le(self.time_boot_ms);
28900 __tmp.put_i32_le(self.lat_int);
28901 __tmp.put_i32_le(self.lon_int);
28902 __tmp.put_f32_le(self.alt);
28903 __tmp.put_f32_le(self.vx);
28904 __tmp.put_f32_le(self.vy);
28905 __tmp.put_f32_le(self.vz);
28906 __tmp.put_f32_le(self.afx);
28907 __tmp.put_f32_le(self.afy);
28908 __tmp.put_f32_le(self.afz);
28909 __tmp.put_f32_le(self.yaw);
28910 __tmp.put_f32_le(self.yaw_rate);
28911 __tmp.put_u16_le(self.type_mask.bits());
28912 __tmp.put_u8(self.target_system);
28913 __tmp.put_u8(self.target_component);
28914 __tmp.put_u8(self.coordinate_frame as u8);
28915 if matches!(version, MavlinkVersion::V2) {
28916 let len = __tmp.len();
28917 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28918 } else {
28919 __tmp.len()
28920 }
28921 }
28922}
28923#[doc = "Sets a desired vehicle position in a local north-east-down coordinate frame. Used by an external controller to command the vehicle (manual controller or other system)."]
28924#[doc = ""]
28925#[doc = "ID: 84"]
28926#[derive(Debug, Clone, PartialEq)]
28927#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28928#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28929#[cfg_attr(feature = "ts", derive(TS))]
28930#[cfg_attr(feature = "ts", ts(export))]
28931pub struct SET_POSITION_TARGET_LOCAL_NED_DATA {
28932 #[doc = "Timestamp (time since system boot)."]
28933 pub time_boot_ms: u32,
28934 #[doc = "X Position in NED frame"]
28935 pub x: f32,
28936 #[doc = "Y Position in NED frame"]
28937 pub y: f32,
28938 #[doc = "Z Position in NED frame (note, altitude is negative in NED)"]
28939 pub z: f32,
28940 #[doc = "X velocity in NED frame"]
28941 pub vx: f32,
28942 #[doc = "Y velocity in NED frame"]
28943 pub vy: f32,
28944 #[doc = "Z velocity in NED frame"]
28945 pub vz: f32,
28946 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28947 pub afx: f32,
28948 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28949 pub afy: f32,
28950 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28951 pub afz: f32,
28952 #[doc = "yaw setpoint"]
28953 pub yaw: f32,
28954 #[doc = "yaw rate setpoint"]
28955 pub yaw_rate: f32,
28956 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
28957 pub type_mask: PositionTargetTypemask,
28958 #[doc = "System ID"]
28959 pub target_system: u8,
28960 #[doc = "Component ID"]
28961 pub target_component: u8,
28962 #[doc = "Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9"]
28963 pub coordinate_frame: MavFrame,
28964}
28965impl SET_POSITION_TARGET_LOCAL_NED_DATA {
28966 pub const ENCODED_LEN: usize = 53usize;
28967 pub const DEFAULT: Self = Self {
28968 time_boot_ms: 0_u32,
28969 x: 0.0_f32,
28970 y: 0.0_f32,
28971 z: 0.0_f32,
28972 vx: 0.0_f32,
28973 vy: 0.0_f32,
28974 vz: 0.0_f32,
28975 afx: 0.0_f32,
28976 afy: 0.0_f32,
28977 afz: 0.0_f32,
28978 yaw: 0.0_f32,
28979 yaw_rate: 0.0_f32,
28980 type_mask: PositionTargetTypemask::DEFAULT,
28981 target_system: 0_u8,
28982 target_component: 0_u8,
28983 coordinate_frame: MavFrame::DEFAULT,
28984 };
28985 #[cfg(feature = "arbitrary")]
28986 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28987 use arbitrary::{Arbitrary, Unstructured};
28988 let mut buf = [0u8; 1024];
28989 rng.fill_bytes(&mut buf);
28990 let mut unstructured = Unstructured::new(&buf);
28991 Self::arbitrary(&mut unstructured).unwrap_or_default()
28992 }
28993}
28994impl Default for SET_POSITION_TARGET_LOCAL_NED_DATA {
28995 fn default() -> Self {
28996 Self::DEFAULT.clone()
28997 }
28998}
28999impl MessageData for SET_POSITION_TARGET_LOCAL_NED_DATA {
29000 type Message = MavMessage;
29001 const ID: u32 = 84u32;
29002 const NAME: &'static str = "SET_POSITION_TARGET_LOCAL_NED";
29003 const EXTRA_CRC: u8 = 143u8;
29004 const ENCODED_LEN: usize = 53usize;
29005 fn deser(
29006 _version: MavlinkVersion,
29007 __input: &[u8],
29008 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29009 let avail_len = __input.len();
29010 let mut payload_buf = [0; Self::ENCODED_LEN];
29011 let mut buf = if avail_len < Self::ENCODED_LEN {
29012 payload_buf[0..avail_len].copy_from_slice(__input);
29013 Bytes::new(&payload_buf)
29014 } else {
29015 Bytes::new(__input)
29016 };
29017 let mut __struct = Self::default();
29018 __struct.time_boot_ms = buf.get_u32_le();
29019 __struct.x = buf.get_f32_le();
29020 __struct.y = buf.get_f32_le();
29021 __struct.z = buf.get_f32_le();
29022 __struct.vx = buf.get_f32_le();
29023 __struct.vy = buf.get_f32_le();
29024 __struct.vz = buf.get_f32_le();
29025 __struct.afx = buf.get_f32_le();
29026 __struct.afy = buf.get_f32_le();
29027 __struct.afz = buf.get_f32_le();
29028 __struct.yaw = buf.get_f32_le();
29029 __struct.yaw_rate = buf.get_f32_le();
29030 let tmp = buf.get_u16_le();
29031 __struct.type_mask = PositionTargetTypemask::from_bits(
29032 tmp & PositionTargetTypemask::all().bits(),
29033 )
29034 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29035 flag_type: "PositionTargetTypemask",
29036 value: tmp as u32,
29037 })?;
29038 __struct.target_system = buf.get_u8();
29039 __struct.target_component = buf.get_u8();
29040 let tmp = buf.get_u8();
29041 __struct.coordinate_frame =
29042 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29043 enum_type: "MavFrame",
29044 value: tmp as u32,
29045 })?;
29046 Ok(__struct)
29047 }
29048 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29049 let mut __tmp = BytesMut::new(bytes);
29050 #[allow(clippy::absurd_extreme_comparisons)]
29051 #[allow(unused_comparisons)]
29052 if __tmp.remaining() < Self::ENCODED_LEN {
29053 panic!(
29054 "buffer is too small (need {} bytes, but got {})",
29055 Self::ENCODED_LEN,
29056 __tmp.remaining(),
29057 )
29058 }
29059 __tmp.put_u32_le(self.time_boot_ms);
29060 __tmp.put_f32_le(self.x);
29061 __tmp.put_f32_le(self.y);
29062 __tmp.put_f32_le(self.z);
29063 __tmp.put_f32_le(self.vx);
29064 __tmp.put_f32_le(self.vy);
29065 __tmp.put_f32_le(self.vz);
29066 __tmp.put_f32_le(self.afx);
29067 __tmp.put_f32_le(self.afy);
29068 __tmp.put_f32_le(self.afz);
29069 __tmp.put_f32_le(self.yaw);
29070 __tmp.put_f32_le(self.yaw_rate);
29071 __tmp.put_u16_le(self.type_mask.bits());
29072 __tmp.put_u8(self.target_system);
29073 __tmp.put_u8(self.target_component);
29074 __tmp.put_u8(self.coordinate_frame as u8);
29075 if matches!(version, MavlinkVersion::V2) {
29076 let len = __tmp.len();
29077 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29078 } else {
29079 __tmp.len()
29080 }
29081 }
29082}
29083#[doc = "Status of simulation environment, if used."]
29084#[doc = ""]
29085#[doc = "ID: 108"]
29086#[derive(Debug, Clone, PartialEq)]
29087#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29088#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29089#[cfg_attr(feature = "ts", derive(TS))]
29090#[cfg_attr(feature = "ts", ts(export))]
29091pub struct SIM_STATE_DATA {
29092 #[doc = "True attitude quaternion component 1, w (1 in null-rotation)"]
29093 pub q1: f32,
29094 #[doc = "True attitude quaternion component 2, x (0 in null-rotation)"]
29095 pub q2: f32,
29096 #[doc = "True attitude quaternion component 3, y (0 in null-rotation)"]
29097 pub q3: f32,
29098 #[doc = "True attitude quaternion component 4, z (0 in null-rotation)"]
29099 pub q4: f32,
29100 #[doc = "Attitude roll expressed as Euler angles, not recommended except for human-readable outputs"]
29101 pub roll: f32,
29102 #[doc = "Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs"]
29103 pub pitch: f32,
29104 #[doc = "Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs"]
29105 pub yaw: f32,
29106 #[doc = "X acceleration"]
29107 pub xacc: f32,
29108 #[doc = "Y acceleration"]
29109 pub yacc: f32,
29110 #[doc = "Z acceleration"]
29111 pub zacc: f32,
29112 #[doc = "Angular speed around X axis"]
29113 pub xgyro: f32,
29114 #[doc = "Angular speed around Y axis"]
29115 pub ygyro: f32,
29116 #[doc = "Angular speed around Z axis"]
29117 pub zgyro: f32,
29118 #[doc = "Latitude (lower precision). Both this and the lat_int field should be set."]
29119 pub lat: f32,
29120 #[doc = "Longitude (lower precision). Both this and the lon_int field should be set."]
29121 pub lon: f32,
29122 #[doc = "Altitude"]
29123 pub alt: f32,
29124 #[doc = "Horizontal position standard deviation"]
29125 pub std_dev_horz: f32,
29126 #[doc = "Vertical position standard deviation"]
29127 pub std_dev_vert: f32,
29128 #[doc = "True velocity in north direction in earth-fixed NED frame"]
29129 pub vn: f32,
29130 #[doc = "True velocity in east direction in earth-fixed NED frame"]
29131 pub ve: f32,
29132 #[doc = "True velocity in down direction in earth-fixed NED frame"]
29133 pub vd: f32,
29134 #[doc = "Latitude (higher precision). If 0, recipients should use the lat field value (otherwise this field is preferred)."]
29135 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29136 pub lat_int: i32,
29137 #[doc = "Longitude (higher precision). If 0, recipients should use the lon field value (otherwise this field is preferred)."]
29138 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29139 pub lon_int: i32,
29140}
29141impl SIM_STATE_DATA {
29142 pub const ENCODED_LEN: usize = 92usize;
29143 pub const DEFAULT: Self = Self {
29144 q1: 0.0_f32,
29145 q2: 0.0_f32,
29146 q3: 0.0_f32,
29147 q4: 0.0_f32,
29148 roll: 0.0_f32,
29149 pitch: 0.0_f32,
29150 yaw: 0.0_f32,
29151 xacc: 0.0_f32,
29152 yacc: 0.0_f32,
29153 zacc: 0.0_f32,
29154 xgyro: 0.0_f32,
29155 ygyro: 0.0_f32,
29156 zgyro: 0.0_f32,
29157 lat: 0.0_f32,
29158 lon: 0.0_f32,
29159 alt: 0.0_f32,
29160 std_dev_horz: 0.0_f32,
29161 std_dev_vert: 0.0_f32,
29162 vn: 0.0_f32,
29163 ve: 0.0_f32,
29164 vd: 0.0_f32,
29165 lat_int: 0_i32,
29166 lon_int: 0_i32,
29167 };
29168 #[cfg(feature = "arbitrary")]
29169 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29170 use arbitrary::{Arbitrary, Unstructured};
29171 let mut buf = [0u8; 1024];
29172 rng.fill_bytes(&mut buf);
29173 let mut unstructured = Unstructured::new(&buf);
29174 Self::arbitrary(&mut unstructured).unwrap_or_default()
29175 }
29176}
29177impl Default for SIM_STATE_DATA {
29178 fn default() -> Self {
29179 Self::DEFAULT.clone()
29180 }
29181}
29182impl MessageData for SIM_STATE_DATA {
29183 type Message = MavMessage;
29184 const ID: u32 = 108u32;
29185 const NAME: &'static str = "SIM_STATE";
29186 const EXTRA_CRC: u8 = 32u8;
29187 const ENCODED_LEN: usize = 92usize;
29188 fn deser(
29189 _version: MavlinkVersion,
29190 __input: &[u8],
29191 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29192 let avail_len = __input.len();
29193 let mut payload_buf = [0; Self::ENCODED_LEN];
29194 let mut buf = if avail_len < Self::ENCODED_LEN {
29195 payload_buf[0..avail_len].copy_from_slice(__input);
29196 Bytes::new(&payload_buf)
29197 } else {
29198 Bytes::new(__input)
29199 };
29200 let mut __struct = Self::default();
29201 __struct.q1 = buf.get_f32_le();
29202 __struct.q2 = buf.get_f32_le();
29203 __struct.q3 = buf.get_f32_le();
29204 __struct.q4 = buf.get_f32_le();
29205 __struct.roll = buf.get_f32_le();
29206 __struct.pitch = buf.get_f32_le();
29207 __struct.yaw = buf.get_f32_le();
29208 __struct.xacc = buf.get_f32_le();
29209 __struct.yacc = buf.get_f32_le();
29210 __struct.zacc = buf.get_f32_le();
29211 __struct.xgyro = buf.get_f32_le();
29212 __struct.ygyro = buf.get_f32_le();
29213 __struct.zgyro = buf.get_f32_le();
29214 __struct.lat = buf.get_f32_le();
29215 __struct.lon = buf.get_f32_le();
29216 __struct.alt = buf.get_f32_le();
29217 __struct.std_dev_horz = buf.get_f32_le();
29218 __struct.std_dev_vert = buf.get_f32_le();
29219 __struct.vn = buf.get_f32_le();
29220 __struct.ve = buf.get_f32_le();
29221 __struct.vd = buf.get_f32_le();
29222 __struct.lat_int = buf.get_i32_le();
29223 __struct.lon_int = buf.get_i32_le();
29224 Ok(__struct)
29225 }
29226 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29227 let mut __tmp = BytesMut::new(bytes);
29228 #[allow(clippy::absurd_extreme_comparisons)]
29229 #[allow(unused_comparisons)]
29230 if __tmp.remaining() < Self::ENCODED_LEN {
29231 panic!(
29232 "buffer is too small (need {} bytes, but got {})",
29233 Self::ENCODED_LEN,
29234 __tmp.remaining(),
29235 )
29236 }
29237 __tmp.put_f32_le(self.q1);
29238 __tmp.put_f32_le(self.q2);
29239 __tmp.put_f32_le(self.q3);
29240 __tmp.put_f32_le(self.q4);
29241 __tmp.put_f32_le(self.roll);
29242 __tmp.put_f32_le(self.pitch);
29243 __tmp.put_f32_le(self.yaw);
29244 __tmp.put_f32_le(self.xacc);
29245 __tmp.put_f32_le(self.yacc);
29246 __tmp.put_f32_le(self.zacc);
29247 __tmp.put_f32_le(self.xgyro);
29248 __tmp.put_f32_le(self.ygyro);
29249 __tmp.put_f32_le(self.zgyro);
29250 __tmp.put_f32_le(self.lat);
29251 __tmp.put_f32_le(self.lon);
29252 __tmp.put_f32_le(self.alt);
29253 __tmp.put_f32_le(self.std_dev_horz);
29254 __tmp.put_f32_le(self.std_dev_vert);
29255 __tmp.put_f32_le(self.vn);
29256 __tmp.put_f32_le(self.ve);
29257 __tmp.put_f32_le(self.vd);
29258 if matches!(version, MavlinkVersion::V2) {
29259 __tmp.put_i32_le(self.lat_int);
29260 __tmp.put_i32_le(self.lon_int);
29261 let len = __tmp.len();
29262 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29263 } else {
29264 __tmp.len()
29265 }
29266 }
29267}
29268#[deprecated = "The BATTERY_INFO message is better aligned with UAVCAN messages, and in any case is useful even if a battery is not \"smart\". See `BATTERY_INFO` (Deprecated since 2024-02)"]
29269#[doc = "Smart Battery information (static/infrequent update). Use for updates from: smart battery to flight stack, flight stack to GCS. Use BATTERY_STATUS for the frequent battery updates."]
29270#[doc = ""]
29271#[doc = "ID: 370"]
29272#[derive(Debug, Clone, PartialEq)]
29273#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29274#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29275#[cfg_attr(feature = "ts", derive(TS))]
29276#[cfg_attr(feature = "ts", ts(export))]
29277pub struct SMART_BATTERY_INFO_DATA {
29278 #[doc = "Capacity when full according to manufacturer, -1: field not provided."]
29279 pub capacity_full_specification: i32,
29280 #[doc = "Capacity when full (accounting for battery degradation), -1: field not provided."]
29281 pub capacity_full: i32,
29282 #[doc = "Charge/discharge cycle count. UINT16_MAX: field not provided."]
29283 pub cycle_count: u16,
29284 #[doc = "Battery weight. 0: field not provided."]
29285 pub weight: u16,
29286 #[doc = "Minimum per-cell voltage when discharging. If not supplied set to UINT16_MAX value."]
29287 pub discharge_minimum_voltage: u16,
29288 #[doc = "Minimum per-cell voltage when charging. If not supplied set to UINT16_MAX value."]
29289 pub charging_minimum_voltage: u16,
29290 #[doc = "Minimum per-cell voltage when resting. If not supplied set to UINT16_MAX value."]
29291 pub resting_minimum_voltage: u16,
29292 #[doc = "Battery ID"]
29293 pub id: u8,
29294 #[doc = "Function of the battery"]
29295 pub battery_function: MavBatteryFunction,
29296 #[doc = "Type (chemistry) of the battery"]
29297 pub mavtype: MavBatteryType,
29298 #[doc = "Serial number in ASCII characters, 0 terminated. All 0: field not provided."]
29299 #[cfg_attr(
29300 feature = "serde",
29301 serde(
29302 serialize_with = "crate::nulstr::serialize::<_, 16>",
29303 deserialize_with = "crate::nulstr::deserialize::<_, 16>"
29304 )
29305 )]
29306 #[cfg_attr(feature = "ts", ts(type = "string"))]
29307 pub serial_number: [u8; 16],
29308 #[doc = "Static device name in ASCII characters, 0 terminated. All 0: field not provided. Encode as manufacturer name then product name separated using an underscore."]
29309 #[cfg_attr(
29310 feature = "serde",
29311 serde(
29312 serialize_with = "crate::nulstr::serialize::<_, 50>",
29313 deserialize_with = "crate::nulstr::deserialize::<_, 50>"
29314 )
29315 )]
29316 #[cfg_attr(feature = "ts", ts(type = "string"))]
29317 pub device_name: [u8; 50],
29318 #[doc = "Maximum per-cell voltage when charged. 0: field not provided."]
29319 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29320 pub charging_maximum_voltage: u16,
29321 #[doc = "Number of battery cells in series. 0: field not provided."]
29322 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29323 pub cells_in_series: u8,
29324 #[doc = "Maximum pack discharge current. 0: field not provided."]
29325 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29326 pub discharge_maximum_current: u32,
29327 #[doc = "Maximum pack discharge burst current. 0: field not provided."]
29328 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29329 pub discharge_maximum_burst_current: u32,
29330 #[doc = "Manufacture date (DD/MM/YYYY) in ASCII characters, 0 terminated. All 0: field not provided."]
29331 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29332 #[cfg_attr(
29333 feature = "serde",
29334 serde(
29335 serialize_with = "crate::nulstr::serialize::<_, 11>",
29336 deserialize_with = "crate::nulstr::deserialize::<_, 11>"
29337 )
29338 )]
29339 #[cfg_attr(feature = "ts", ts(type = "string"))]
29340 pub manufacture_date: [u8; 11],
29341}
29342impl SMART_BATTERY_INFO_DATA {
29343 pub const ENCODED_LEN: usize = 109usize;
29344 pub const DEFAULT: Self = Self {
29345 capacity_full_specification: 0_i32,
29346 capacity_full: 0_i32,
29347 cycle_count: 0_u16,
29348 weight: 0_u16,
29349 discharge_minimum_voltage: 0_u16,
29350 charging_minimum_voltage: 0_u16,
29351 resting_minimum_voltage: 0_u16,
29352 id: 0_u8,
29353 battery_function: MavBatteryFunction::DEFAULT,
29354 mavtype: MavBatteryType::DEFAULT,
29355 serial_number: [0_u8; 16usize],
29356 device_name: [0_u8; 50usize],
29357 charging_maximum_voltage: 0_u16,
29358 cells_in_series: 0_u8,
29359 discharge_maximum_current: 0_u32,
29360 discharge_maximum_burst_current: 0_u32,
29361 manufacture_date: [0_u8; 11usize],
29362 };
29363 #[cfg(feature = "arbitrary")]
29364 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29365 use arbitrary::{Arbitrary, Unstructured};
29366 let mut buf = [0u8; 1024];
29367 rng.fill_bytes(&mut buf);
29368 let mut unstructured = Unstructured::new(&buf);
29369 Self::arbitrary(&mut unstructured).unwrap_or_default()
29370 }
29371}
29372impl Default for SMART_BATTERY_INFO_DATA {
29373 fn default() -> Self {
29374 Self::DEFAULT.clone()
29375 }
29376}
29377impl MessageData for SMART_BATTERY_INFO_DATA {
29378 type Message = MavMessage;
29379 const ID: u32 = 370u32;
29380 const NAME: &'static str = "SMART_BATTERY_INFO";
29381 const EXTRA_CRC: u8 = 75u8;
29382 const ENCODED_LEN: usize = 109usize;
29383 fn deser(
29384 _version: MavlinkVersion,
29385 __input: &[u8],
29386 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29387 let avail_len = __input.len();
29388 let mut payload_buf = [0; Self::ENCODED_LEN];
29389 let mut buf = if avail_len < Self::ENCODED_LEN {
29390 payload_buf[0..avail_len].copy_from_slice(__input);
29391 Bytes::new(&payload_buf)
29392 } else {
29393 Bytes::new(__input)
29394 };
29395 let mut __struct = Self::default();
29396 __struct.capacity_full_specification = buf.get_i32_le();
29397 __struct.capacity_full = buf.get_i32_le();
29398 __struct.cycle_count = buf.get_u16_le();
29399 __struct.weight = buf.get_u16_le();
29400 __struct.discharge_minimum_voltage = buf.get_u16_le();
29401 __struct.charging_minimum_voltage = buf.get_u16_le();
29402 __struct.resting_minimum_voltage = buf.get_u16_le();
29403 __struct.id = buf.get_u8();
29404 let tmp = buf.get_u8();
29405 __struct.battery_function =
29406 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29407 enum_type: "MavBatteryFunction",
29408 value: tmp as u32,
29409 })?;
29410 let tmp = buf.get_u8();
29411 __struct.mavtype =
29412 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29413 enum_type: "MavBatteryType",
29414 value: tmp as u32,
29415 })?;
29416 for v in &mut __struct.serial_number {
29417 let val = buf.get_u8();
29418 *v = val;
29419 }
29420 for v in &mut __struct.device_name {
29421 let val = buf.get_u8();
29422 *v = val;
29423 }
29424 __struct.charging_maximum_voltage = buf.get_u16_le();
29425 __struct.cells_in_series = buf.get_u8();
29426 __struct.discharge_maximum_current = buf.get_u32_le();
29427 __struct.discharge_maximum_burst_current = buf.get_u32_le();
29428 for v in &mut __struct.manufacture_date {
29429 let val = buf.get_u8();
29430 *v = val;
29431 }
29432 Ok(__struct)
29433 }
29434 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29435 let mut __tmp = BytesMut::new(bytes);
29436 #[allow(clippy::absurd_extreme_comparisons)]
29437 #[allow(unused_comparisons)]
29438 if __tmp.remaining() < Self::ENCODED_LEN {
29439 panic!(
29440 "buffer is too small (need {} bytes, but got {})",
29441 Self::ENCODED_LEN,
29442 __tmp.remaining(),
29443 )
29444 }
29445 __tmp.put_i32_le(self.capacity_full_specification);
29446 __tmp.put_i32_le(self.capacity_full);
29447 __tmp.put_u16_le(self.cycle_count);
29448 __tmp.put_u16_le(self.weight);
29449 __tmp.put_u16_le(self.discharge_minimum_voltage);
29450 __tmp.put_u16_le(self.charging_minimum_voltage);
29451 __tmp.put_u16_le(self.resting_minimum_voltage);
29452 __tmp.put_u8(self.id);
29453 __tmp.put_u8(self.battery_function as u8);
29454 __tmp.put_u8(self.mavtype as u8);
29455 for val in &self.serial_number {
29456 __tmp.put_u8(*val);
29457 }
29458 for val in &self.device_name {
29459 __tmp.put_u8(*val);
29460 }
29461 if matches!(version, MavlinkVersion::V2) {
29462 __tmp.put_u16_le(self.charging_maximum_voltage);
29463 __tmp.put_u8(self.cells_in_series);
29464 __tmp.put_u32_le(self.discharge_maximum_current);
29465 __tmp.put_u32_le(self.discharge_maximum_burst_current);
29466 for val in &self.manufacture_date {
29467 __tmp.put_u8(*val);
29468 }
29469 let len = __tmp.len();
29470 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29471 } else {
29472 __tmp.len()
29473 }
29474 }
29475}
29476#[doc = "Status text message. These messages are printed in yellow in the COMM console of QGroundControl. WARNING: They consume quite some bandwidth, so use only for important status and error messages. If implemented wisely, these messages are buffered on the MCU and sent only at a limited rate (e.g. 10 Hz)."]
29477#[doc = ""]
29478#[doc = "ID: 253"]
29479#[derive(Debug, Clone, PartialEq)]
29480#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29481#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29482#[cfg_attr(feature = "ts", derive(TS))]
29483#[cfg_attr(feature = "ts", ts(export))]
29484pub struct STATUSTEXT_DATA {
29485 #[doc = "Severity of status. Relies on the definitions within RFC-5424."]
29486 pub severity: MavSeverity,
29487 #[doc = "Status text message, without null termination character"]
29488 #[cfg_attr(
29489 feature = "serde",
29490 serde(
29491 serialize_with = "crate::nulstr::serialize::<_, 50>",
29492 deserialize_with = "crate::nulstr::deserialize::<_, 50>"
29493 )
29494 )]
29495 #[cfg_attr(feature = "ts", ts(type = "string"))]
29496 pub text: [u8; 50],
29497 #[doc = "Unique (opaque) identifier for this statustext message. May be used to reassemble a logical long-statustext message from a sequence of chunks. A value of zero indicates this is the only chunk in the sequence and the message can be emitted immediately."]
29498 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29499 pub id: u16,
29500 #[doc = "This chunk's sequence number; indexing is from zero. Any null character in the text field is taken to mean this was the last chunk."]
29501 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29502 pub chunk_seq: u8,
29503}
29504impl STATUSTEXT_DATA {
29505 pub const ENCODED_LEN: usize = 54usize;
29506 pub const DEFAULT: Self = Self {
29507 severity: MavSeverity::DEFAULT,
29508 text: [0_u8; 50usize],
29509 id: 0_u16,
29510 chunk_seq: 0_u8,
29511 };
29512 #[cfg(feature = "arbitrary")]
29513 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29514 use arbitrary::{Arbitrary, Unstructured};
29515 let mut buf = [0u8; 1024];
29516 rng.fill_bytes(&mut buf);
29517 let mut unstructured = Unstructured::new(&buf);
29518 Self::arbitrary(&mut unstructured).unwrap_or_default()
29519 }
29520}
29521impl Default for STATUSTEXT_DATA {
29522 fn default() -> Self {
29523 Self::DEFAULT.clone()
29524 }
29525}
29526impl MessageData for STATUSTEXT_DATA {
29527 type Message = MavMessage;
29528 const ID: u32 = 253u32;
29529 const NAME: &'static str = "STATUSTEXT";
29530 const EXTRA_CRC: u8 = 83u8;
29531 const ENCODED_LEN: usize = 54usize;
29532 fn deser(
29533 _version: MavlinkVersion,
29534 __input: &[u8],
29535 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29536 let avail_len = __input.len();
29537 let mut payload_buf = [0; Self::ENCODED_LEN];
29538 let mut buf = if avail_len < Self::ENCODED_LEN {
29539 payload_buf[0..avail_len].copy_from_slice(__input);
29540 Bytes::new(&payload_buf)
29541 } else {
29542 Bytes::new(__input)
29543 };
29544 let mut __struct = Self::default();
29545 let tmp = buf.get_u8();
29546 __struct.severity =
29547 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29548 enum_type: "MavSeverity",
29549 value: tmp as u32,
29550 })?;
29551 for v in &mut __struct.text {
29552 let val = buf.get_u8();
29553 *v = val;
29554 }
29555 __struct.id = buf.get_u16_le();
29556 __struct.chunk_seq = buf.get_u8();
29557 Ok(__struct)
29558 }
29559 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29560 let mut __tmp = BytesMut::new(bytes);
29561 #[allow(clippy::absurd_extreme_comparisons)]
29562 #[allow(unused_comparisons)]
29563 if __tmp.remaining() < Self::ENCODED_LEN {
29564 panic!(
29565 "buffer is too small (need {} bytes, but got {})",
29566 Self::ENCODED_LEN,
29567 __tmp.remaining(),
29568 )
29569 }
29570 __tmp.put_u8(self.severity as u8);
29571 for val in &self.text {
29572 __tmp.put_u8(*val);
29573 }
29574 if matches!(version, MavlinkVersion::V2) {
29575 __tmp.put_u16_le(self.id);
29576 __tmp.put_u8(self.chunk_seq);
29577 let len = __tmp.len();
29578 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29579 } else {
29580 __tmp.len()
29581 }
29582 }
29583}
29584#[doc = "Information about a storage medium. This message is sent in response to a request with MAV_CMD_REQUEST_MESSAGE and whenever the status of the storage changes (STORAGE_STATUS). Use MAV_CMD_REQUEST_MESSAGE.param2 to indicate the index/id of requested storage: 0 for all, 1 for first, 2 for second, etc."]
29585#[doc = ""]
29586#[doc = "ID: 261"]
29587#[derive(Debug, Clone, PartialEq)]
29588#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29589#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29590#[cfg_attr(feature = "ts", derive(TS))]
29591#[cfg_attr(feature = "ts", ts(export))]
29592pub struct STORAGE_INFORMATION_DATA {
29593 #[doc = "Timestamp (time since system boot)."]
29594 pub time_boot_ms: u32,
29595 #[doc = "Total capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
29596 pub total_capacity: f32,
29597 #[doc = "Used capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
29598 pub used_capacity: f32,
29599 #[doc = "Available storage capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
29600 pub available_capacity: f32,
29601 #[doc = "Read speed."]
29602 pub read_speed: f32,
29603 #[doc = "Write speed."]
29604 pub write_speed: f32,
29605 #[doc = "Storage ID (1 for first, 2 for second, etc.)"]
29606 pub storage_id: u8,
29607 #[doc = "Number of storage devices"]
29608 pub storage_count: u8,
29609 #[doc = "Status of storage"]
29610 pub status: StorageStatus,
29611 #[doc = "Type of storage"]
29612 #[cfg_attr(feature = "serde", serde(default))]
29613 pub mavtype: StorageType,
29614 #[doc = "Textual storage name to be used in UI (microSD 1, Internal Memory, etc.) This is a NULL terminated string. If it is exactly 32 characters long, add a terminating NULL. If this string is empty, the generic type is shown to the user."]
29615 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29616 #[cfg_attr(
29617 feature = "serde",
29618 serde(
29619 serialize_with = "crate::nulstr::serialize::<_, 32>",
29620 deserialize_with = "crate::nulstr::deserialize::<_, 32>"
29621 )
29622 )]
29623 #[cfg_attr(feature = "ts", ts(type = "string"))]
29624 pub name: [u8; 32],
29625 #[doc = "Flags indicating whether this instance is preferred storage for photos, videos, etc. Note: Implementations should initially set the flags on the system-default storage id used for saving media (if possible/supported). This setting can then be overridden using MAV_CMD_SET_STORAGE_USAGE. If the media usage flags are not set, a GCS may assume storage ID 1 is the default storage for all media types."]
29626 #[cfg_attr(feature = "serde", serde(default))]
29627 pub storage_usage: StorageUsageFlag,
29628}
29629impl STORAGE_INFORMATION_DATA {
29630 pub const ENCODED_LEN: usize = 61usize;
29631 pub const DEFAULT: Self = Self {
29632 time_boot_ms: 0_u32,
29633 total_capacity: 0.0_f32,
29634 used_capacity: 0.0_f32,
29635 available_capacity: 0.0_f32,
29636 read_speed: 0.0_f32,
29637 write_speed: 0.0_f32,
29638 storage_id: 0_u8,
29639 storage_count: 0_u8,
29640 status: StorageStatus::DEFAULT,
29641 mavtype: StorageType::DEFAULT,
29642 name: [0_u8; 32usize],
29643 storage_usage: StorageUsageFlag::DEFAULT,
29644 };
29645 #[cfg(feature = "arbitrary")]
29646 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29647 use arbitrary::{Arbitrary, Unstructured};
29648 let mut buf = [0u8; 1024];
29649 rng.fill_bytes(&mut buf);
29650 let mut unstructured = Unstructured::new(&buf);
29651 Self::arbitrary(&mut unstructured).unwrap_or_default()
29652 }
29653}
29654impl Default for STORAGE_INFORMATION_DATA {
29655 fn default() -> Self {
29656 Self::DEFAULT.clone()
29657 }
29658}
29659impl MessageData for STORAGE_INFORMATION_DATA {
29660 type Message = MavMessage;
29661 const ID: u32 = 261u32;
29662 const NAME: &'static str = "STORAGE_INFORMATION";
29663 const EXTRA_CRC: u8 = 179u8;
29664 const ENCODED_LEN: usize = 61usize;
29665 fn deser(
29666 _version: MavlinkVersion,
29667 __input: &[u8],
29668 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29669 let avail_len = __input.len();
29670 let mut payload_buf = [0; Self::ENCODED_LEN];
29671 let mut buf = if avail_len < Self::ENCODED_LEN {
29672 payload_buf[0..avail_len].copy_from_slice(__input);
29673 Bytes::new(&payload_buf)
29674 } else {
29675 Bytes::new(__input)
29676 };
29677 let mut __struct = Self::default();
29678 __struct.time_boot_ms = buf.get_u32_le();
29679 __struct.total_capacity = buf.get_f32_le();
29680 __struct.used_capacity = buf.get_f32_le();
29681 __struct.available_capacity = buf.get_f32_le();
29682 __struct.read_speed = buf.get_f32_le();
29683 __struct.write_speed = buf.get_f32_le();
29684 __struct.storage_id = buf.get_u8();
29685 __struct.storage_count = buf.get_u8();
29686 let tmp = buf.get_u8();
29687 __struct.status =
29688 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29689 enum_type: "StorageStatus",
29690 value: tmp as u32,
29691 })?;
29692 let tmp = buf.get_u8();
29693 __struct.mavtype =
29694 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29695 enum_type: "StorageType",
29696 value: tmp as u32,
29697 })?;
29698 for v in &mut __struct.name {
29699 let val = buf.get_u8();
29700 *v = val;
29701 }
29702 let tmp = buf.get_u8();
29703 __struct.storage_usage = StorageUsageFlag::from_bits(tmp & StorageUsageFlag::all().bits())
29704 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29705 flag_type: "StorageUsageFlag",
29706 value: tmp as u32,
29707 })?;
29708 Ok(__struct)
29709 }
29710 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29711 let mut __tmp = BytesMut::new(bytes);
29712 #[allow(clippy::absurd_extreme_comparisons)]
29713 #[allow(unused_comparisons)]
29714 if __tmp.remaining() < Self::ENCODED_LEN {
29715 panic!(
29716 "buffer is too small (need {} bytes, but got {})",
29717 Self::ENCODED_LEN,
29718 __tmp.remaining(),
29719 )
29720 }
29721 __tmp.put_u32_le(self.time_boot_ms);
29722 __tmp.put_f32_le(self.total_capacity);
29723 __tmp.put_f32_le(self.used_capacity);
29724 __tmp.put_f32_le(self.available_capacity);
29725 __tmp.put_f32_le(self.read_speed);
29726 __tmp.put_f32_le(self.write_speed);
29727 __tmp.put_u8(self.storage_id);
29728 __tmp.put_u8(self.storage_count);
29729 __tmp.put_u8(self.status as u8);
29730 if matches!(version, MavlinkVersion::V2) {
29731 __tmp.put_u8(self.mavtype as u8);
29732 for val in &self.name {
29733 __tmp.put_u8(*val);
29734 }
29735 __tmp.put_u8(self.storage_usage.bits());
29736 let len = __tmp.len();
29737 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29738 } else {
29739 __tmp.len()
29740 }
29741 }
29742}
29743#[doc = "Tune formats supported by vehicle. This should be emitted as response to MAV_CMD_REQUEST_MESSAGE."]
29744#[doc = ""]
29745#[doc = "ID: 401"]
29746#[derive(Debug, Clone, PartialEq)]
29747#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29748#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29749#[cfg_attr(feature = "ts", derive(TS))]
29750#[cfg_attr(feature = "ts", ts(export))]
29751pub struct SUPPORTED_TUNES_DATA {
29752 #[doc = "Bitfield of supported tune formats."]
29753 pub format: TuneFormat,
29754 #[doc = "System ID"]
29755 pub target_system: u8,
29756 #[doc = "Component ID"]
29757 pub target_component: u8,
29758}
29759impl SUPPORTED_TUNES_DATA {
29760 pub const ENCODED_LEN: usize = 6usize;
29761 pub const DEFAULT: Self = Self {
29762 format: TuneFormat::DEFAULT,
29763 target_system: 0_u8,
29764 target_component: 0_u8,
29765 };
29766 #[cfg(feature = "arbitrary")]
29767 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29768 use arbitrary::{Arbitrary, Unstructured};
29769 let mut buf = [0u8; 1024];
29770 rng.fill_bytes(&mut buf);
29771 let mut unstructured = Unstructured::new(&buf);
29772 Self::arbitrary(&mut unstructured).unwrap_or_default()
29773 }
29774}
29775impl Default for SUPPORTED_TUNES_DATA {
29776 fn default() -> Self {
29777 Self::DEFAULT.clone()
29778 }
29779}
29780impl MessageData for SUPPORTED_TUNES_DATA {
29781 type Message = MavMessage;
29782 const ID: u32 = 401u32;
29783 const NAME: &'static str = "SUPPORTED_TUNES";
29784 const EXTRA_CRC: u8 = 183u8;
29785 const ENCODED_LEN: usize = 6usize;
29786 fn deser(
29787 _version: MavlinkVersion,
29788 __input: &[u8],
29789 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29790 let avail_len = __input.len();
29791 let mut payload_buf = [0; Self::ENCODED_LEN];
29792 let mut buf = if avail_len < Self::ENCODED_LEN {
29793 payload_buf[0..avail_len].copy_from_slice(__input);
29794 Bytes::new(&payload_buf)
29795 } else {
29796 Bytes::new(__input)
29797 };
29798 let mut __struct = Self::default();
29799 let tmp = buf.get_u32_le();
29800 __struct.format = FromPrimitive::from_u32(tmp).ok_or(
29801 ::mavlink_core::error::ParserError::InvalidEnum {
29802 enum_type: "TuneFormat",
29803 value: tmp as u32,
29804 },
29805 )?;
29806 __struct.target_system = buf.get_u8();
29807 __struct.target_component = buf.get_u8();
29808 Ok(__struct)
29809 }
29810 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29811 let mut __tmp = BytesMut::new(bytes);
29812 #[allow(clippy::absurd_extreme_comparisons)]
29813 #[allow(unused_comparisons)]
29814 if __tmp.remaining() < Self::ENCODED_LEN {
29815 panic!(
29816 "buffer is too small (need {} bytes, but got {})",
29817 Self::ENCODED_LEN,
29818 __tmp.remaining(),
29819 )
29820 }
29821 __tmp.put_u32_le(self.format as u32);
29822 __tmp.put_u8(self.target_system);
29823 __tmp.put_u8(self.target_component);
29824 if matches!(version, MavlinkVersion::V2) {
29825 let len = __tmp.len();
29826 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29827 } else {
29828 __tmp.len()
29829 }
29830 }
29831}
29832#[doc = "The system time is the time of the master clock. This can be emitted by flight controllers, onboard computers, or other components in the MAVLink network. Components that are using a less reliable time source, such as a battery-backed real time clock, can choose to match their system clock to that of a SYSTEM_TYPE that indicates a more recent time. This allows more broadly accurate date stamping of logs, and so on. If precise time synchronization is needed then use TIMESYNC instead."]
29833#[doc = ""]
29834#[doc = "ID: 2"]
29835#[derive(Debug, Clone, PartialEq)]
29836#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29837#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29838#[cfg_attr(feature = "ts", derive(TS))]
29839#[cfg_attr(feature = "ts", ts(export))]
29840pub struct SYSTEM_TIME_DATA {
29841 #[doc = "Timestamp (UNIX epoch time)."]
29842 pub time_unix_usec: u64,
29843 #[doc = "Timestamp (time since system boot)."]
29844 pub time_boot_ms: u32,
29845}
29846impl SYSTEM_TIME_DATA {
29847 pub const ENCODED_LEN: usize = 12usize;
29848 pub const DEFAULT: Self = Self {
29849 time_unix_usec: 0_u64,
29850 time_boot_ms: 0_u32,
29851 };
29852 #[cfg(feature = "arbitrary")]
29853 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29854 use arbitrary::{Arbitrary, Unstructured};
29855 let mut buf = [0u8; 1024];
29856 rng.fill_bytes(&mut buf);
29857 let mut unstructured = Unstructured::new(&buf);
29858 Self::arbitrary(&mut unstructured).unwrap_or_default()
29859 }
29860}
29861impl Default for SYSTEM_TIME_DATA {
29862 fn default() -> Self {
29863 Self::DEFAULT.clone()
29864 }
29865}
29866impl MessageData for SYSTEM_TIME_DATA {
29867 type Message = MavMessage;
29868 const ID: u32 = 2u32;
29869 const NAME: &'static str = "SYSTEM_TIME";
29870 const EXTRA_CRC: u8 = 137u8;
29871 const ENCODED_LEN: usize = 12usize;
29872 fn deser(
29873 _version: MavlinkVersion,
29874 __input: &[u8],
29875 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29876 let avail_len = __input.len();
29877 let mut payload_buf = [0; Self::ENCODED_LEN];
29878 let mut buf = if avail_len < Self::ENCODED_LEN {
29879 payload_buf[0..avail_len].copy_from_slice(__input);
29880 Bytes::new(&payload_buf)
29881 } else {
29882 Bytes::new(__input)
29883 };
29884 let mut __struct = Self::default();
29885 __struct.time_unix_usec = buf.get_u64_le();
29886 __struct.time_boot_ms = buf.get_u32_le();
29887 Ok(__struct)
29888 }
29889 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29890 let mut __tmp = BytesMut::new(bytes);
29891 #[allow(clippy::absurd_extreme_comparisons)]
29892 #[allow(unused_comparisons)]
29893 if __tmp.remaining() < Self::ENCODED_LEN {
29894 panic!(
29895 "buffer is too small (need {} bytes, but got {})",
29896 Self::ENCODED_LEN,
29897 __tmp.remaining(),
29898 )
29899 }
29900 __tmp.put_u64_le(self.time_unix_usec);
29901 __tmp.put_u32_le(self.time_boot_ms);
29902 if matches!(version, MavlinkVersion::V2) {
29903 let len = __tmp.len();
29904 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29905 } else {
29906 __tmp.len()
29907 }
29908 }
29909}
29910#[doc = "The general system state. If the system is following the MAVLink standard, the system state is mainly defined by three orthogonal states/modes: The system mode, which is either LOCKED (motors shut down and locked), MANUAL (system under RC control), GUIDED (system with autonomous position control, position setpoint controlled manually) or AUTO (system guided by path/waypoint planner). The NAV_MODE defined the current flight state: LIFTOFF (often an open-loop maneuver), LANDING, WAYPOINTS or VECTOR. This represents the internal navigation state machine. The system status shows whether the system is currently active or not and if an emergency occurred. During the CRITICAL and EMERGENCY states the MAV is still considered to be active, but should start emergency procedures autonomously. After a failure occurred it should first move from active to critical to allow manual intervention and then move to emergency after a certain timeout."]
29911#[doc = ""]
29912#[doc = "ID: 1"]
29913#[derive(Debug, Clone, PartialEq)]
29914#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29915#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29916#[cfg_attr(feature = "ts", derive(TS))]
29917#[cfg_attr(feature = "ts", ts(export))]
29918pub struct SYS_STATUS_DATA {
29919 #[doc = "Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present."]
29920 pub onboard_control_sensors_present: MavSysStatusSensor,
29921 #[doc = "Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled."]
29922 pub onboard_control_sensors_enabled: MavSysStatusSensor,
29923 #[doc = "Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy."]
29924 pub onboard_control_sensors_health: MavSysStatusSensor,
29925 #[doc = "Maximum usage in percent of the mainloop time. Values: [0-1000] - should always be below 1000"]
29926 pub load: u16,
29927 #[doc = "Battery voltage, UINT16_MAX: Voltage not sent by autopilot"]
29928 pub voltage_battery: u16,
29929 #[doc = "Battery current, -1: Current not sent by autopilot"]
29930 pub current_battery: i16,
29931 #[doc = "Communication drop rate, (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)"]
29932 pub drop_rate_comm: u16,
29933 #[doc = "Communication errors (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)"]
29934 pub errors_comm: u16,
29935 #[doc = "Autopilot-specific errors"]
29936 pub errors_count1: u16,
29937 #[doc = "Autopilot-specific errors"]
29938 pub errors_count2: u16,
29939 #[doc = "Autopilot-specific errors"]
29940 pub errors_count3: u16,
29941 #[doc = "Autopilot-specific errors"]
29942 pub errors_count4: u16,
29943 #[doc = "Battery energy remaining, -1: Battery remaining energy not sent by autopilot"]
29944 pub battery_remaining: i8,
29945 #[doc = "Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present."]
29946 #[cfg_attr(feature = "serde", serde(default))]
29947 pub onboard_control_sensors_present_extended: MavSysStatusSensorExtended,
29948 #[doc = "Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled."]
29949 #[cfg_attr(feature = "serde", serde(default))]
29950 pub onboard_control_sensors_enabled_extended: MavSysStatusSensorExtended,
29951 #[doc = "Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy."]
29952 #[cfg_attr(feature = "serde", serde(default))]
29953 pub onboard_control_sensors_health_extended: MavSysStatusSensorExtended,
29954}
29955impl SYS_STATUS_DATA {
29956 pub const ENCODED_LEN: usize = 43usize;
29957 pub const DEFAULT: Self = Self {
29958 onboard_control_sensors_present: MavSysStatusSensor::DEFAULT,
29959 onboard_control_sensors_enabled: MavSysStatusSensor::DEFAULT,
29960 onboard_control_sensors_health: MavSysStatusSensor::DEFAULT,
29961 load: 0_u16,
29962 voltage_battery: 0_u16,
29963 current_battery: 0_i16,
29964 drop_rate_comm: 0_u16,
29965 errors_comm: 0_u16,
29966 errors_count1: 0_u16,
29967 errors_count2: 0_u16,
29968 errors_count3: 0_u16,
29969 errors_count4: 0_u16,
29970 battery_remaining: 0_i8,
29971 onboard_control_sensors_present_extended: MavSysStatusSensorExtended::DEFAULT,
29972 onboard_control_sensors_enabled_extended: MavSysStatusSensorExtended::DEFAULT,
29973 onboard_control_sensors_health_extended: MavSysStatusSensorExtended::DEFAULT,
29974 };
29975 #[cfg(feature = "arbitrary")]
29976 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29977 use arbitrary::{Arbitrary, Unstructured};
29978 let mut buf = [0u8; 1024];
29979 rng.fill_bytes(&mut buf);
29980 let mut unstructured = Unstructured::new(&buf);
29981 Self::arbitrary(&mut unstructured).unwrap_or_default()
29982 }
29983}
29984impl Default for SYS_STATUS_DATA {
29985 fn default() -> Self {
29986 Self::DEFAULT.clone()
29987 }
29988}
29989impl MessageData for SYS_STATUS_DATA {
29990 type Message = MavMessage;
29991 const ID: u32 = 1u32;
29992 const NAME: &'static str = "SYS_STATUS";
29993 const EXTRA_CRC: u8 = 124u8;
29994 const ENCODED_LEN: usize = 43usize;
29995 fn deser(
29996 _version: MavlinkVersion,
29997 __input: &[u8],
29998 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29999 let avail_len = __input.len();
30000 let mut payload_buf = [0; Self::ENCODED_LEN];
30001 let mut buf = if avail_len < Self::ENCODED_LEN {
30002 payload_buf[0..avail_len].copy_from_slice(__input);
30003 Bytes::new(&payload_buf)
30004 } else {
30005 Bytes::new(__input)
30006 };
30007 let mut __struct = Self::default();
30008 let tmp = buf.get_u32_le();
30009 __struct.onboard_control_sensors_present = MavSysStatusSensor::from_bits(
30010 tmp & MavSysStatusSensor::all().bits(),
30011 )
30012 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
30013 flag_type: "MavSysStatusSensor",
30014 value: tmp as u32,
30015 })?;
30016 let tmp = buf.get_u32_le();
30017 __struct.onboard_control_sensors_enabled = MavSysStatusSensor::from_bits(
30018 tmp & MavSysStatusSensor::all().bits(),
30019 )
30020 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
30021 flag_type: "MavSysStatusSensor",
30022 value: tmp as u32,
30023 })?;
30024 let tmp = buf.get_u32_le();
30025 __struct.onboard_control_sensors_health = MavSysStatusSensor::from_bits(
30026 tmp & MavSysStatusSensor::all().bits(),
30027 )
30028 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
30029 flag_type: "MavSysStatusSensor",
30030 value: tmp as u32,
30031 })?;
30032 __struct.load = buf.get_u16_le();
30033 __struct.voltage_battery = buf.get_u16_le();
30034 __struct.current_battery = buf.get_i16_le();
30035 __struct.drop_rate_comm = buf.get_u16_le();
30036 __struct.errors_comm = buf.get_u16_le();
30037 __struct.errors_count1 = buf.get_u16_le();
30038 __struct.errors_count2 = buf.get_u16_le();
30039 __struct.errors_count3 = buf.get_u16_le();
30040 __struct.errors_count4 = buf.get_u16_le();
30041 __struct.battery_remaining = buf.get_i8();
30042 let tmp = buf.get_u32_le();
30043 __struct.onboard_control_sensors_present_extended =
30044 MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
30045 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
30046 flag_type: "MavSysStatusSensorExtended",
30047 value: tmp as u32,
30048 })?;
30049 let tmp = buf.get_u32_le();
30050 __struct.onboard_control_sensors_enabled_extended =
30051 MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
30052 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
30053 flag_type: "MavSysStatusSensorExtended",
30054 value: tmp as u32,
30055 })?;
30056 let tmp = buf.get_u32_le();
30057 __struct.onboard_control_sensors_health_extended =
30058 MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
30059 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
30060 flag_type: "MavSysStatusSensorExtended",
30061 value: tmp as u32,
30062 })?;
30063 Ok(__struct)
30064 }
30065 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30066 let mut __tmp = BytesMut::new(bytes);
30067 #[allow(clippy::absurd_extreme_comparisons)]
30068 #[allow(unused_comparisons)]
30069 if __tmp.remaining() < Self::ENCODED_LEN {
30070 panic!(
30071 "buffer is too small (need {} bytes, but got {})",
30072 Self::ENCODED_LEN,
30073 __tmp.remaining(),
30074 )
30075 }
30076 __tmp.put_u32_le(self.onboard_control_sensors_present.bits());
30077 __tmp.put_u32_le(self.onboard_control_sensors_enabled.bits());
30078 __tmp.put_u32_le(self.onboard_control_sensors_health.bits());
30079 __tmp.put_u16_le(self.load);
30080 __tmp.put_u16_le(self.voltage_battery);
30081 __tmp.put_i16_le(self.current_battery);
30082 __tmp.put_u16_le(self.drop_rate_comm);
30083 __tmp.put_u16_le(self.errors_comm);
30084 __tmp.put_u16_le(self.errors_count1);
30085 __tmp.put_u16_le(self.errors_count2);
30086 __tmp.put_u16_le(self.errors_count3);
30087 __tmp.put_u16_le(self.errors_count4);
30088 __tmp.put_i8(self.battery_remaining);
30089 if matches!(version, MavlinkVersion::V2) {
30090 __tmp.put_u32_le(self.onboard_control_sensors_present_extended.bits());
30091 __tmp.put_u32_le(self.onboard_control_sensors_enabled_extended.bits());
30092 __tmp.put_u32_le(self.onboard_control_sensors_health_extended.bits());
30093 let len = __tmp.len();
30094 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30095 } else {
30096 __tmp.len()
30097 }
30098 }
30099}
30100#[doc = "Request that the vehicle report terrain height at the given location (expected response is a TERRAIN_REPORT). Used by GCS to check if vehicle has all terrain data needed for a mission."]
30101#[doc = ""]
30102#[doc = "ID: 135"]
30103#[derive(Debug, Clone, PartialEq)]
30104#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30105#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30106#[cfg_attr(feature = "ts", derive(TS))]
30107#[cfg_attr(feature = "ts", ts(export))]
30108pub struct TERRAIN_CHECK_DATA {
30109 #[doc = "Latitude"]
30110 pub lat: i32,
30111 #[doc = "Longitude"]
30112 pub lon: i32,
30113}
30114impl TERRAIN_CHECK_DATA {
30115 pub const ENCODED_LEN: usize = 8usize;
30116 pub const DEFAULT: Self = Self {
30117 lat: 0_i32,
30118 lon: 0_i32,
30119 };
30120 #[cfg(feature = "arbitrary")]
30121 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30122 use arbitrary::{Arbitrary, Unstructured};
30123 let mut buf = [0u8; 1024];
30124 rng.fill_bytes(&mut buf);
30125 let mut unstructured = Unstructured::new(&buf);
30126 Self::arbitrary(&mut unstructured).unwrap_or_default()
30127 }
30128}
30129impl Default for TERRAIN_CHECK_DATA {
30130 fn default() -> Self {
30131 Self::DEFAULT.clone()
30132 }
30133}
30134impl MessageData for TERRAIN_CHECK_DATA {
30135 type Message = MavMessage;
30136 const ID: u32 = 135u32;
30137 const NAME: &'static str = "TERRAIN_CHECK";
30138 const EXTRA_CRC: u8 = 203u8;
30139 const ENCODED_LEN: usize = 8usize;
30140 fn deser(
30141 _version: MavlinkVersion,
30142 __input: &[u8],
30143 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30144 let avail_len = __input.len();
30145 let mut payload_buf = [0; Self::ENCODED_LEN];
30146 let mut buf = if avail_len < Self::ENCODED_LEN {
30147 payload_buf[0..avail_len].copy_from_slice(__input);
30148 Bytes::new(&payload_buf)
30149 } else {
30150 Bytes::new(__input)
30151 };
30152 let mut __struct = Self::default();
30153 __struct.lat = buf.get_i32_le();
30154 __struct.lon = buf.get_i32_le();
30155 Ok(__struct)
30156 }
30157 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30158 let mut __tmp = BytesMut::new(bytes);
30159 #[allow(clippy::absurd_extreme_comparisons)]
30160 #[allow(unused_comparisons)]
30161 if __tmp.remaining() < Self::ENCODED_LEN {
30162 panic!(
30163 "buffer is too small (need {} bytes, but got {})",
30164 Self::ENCODED_LEN,
30165 __tmp.remaining(),
30166 )
30167 }
30168 __tmp.put_i32_le(self.lat);
30169 __tmp.put_i32_le(self.lon);
30170 if matches!(version, MavlinkVersion::V2) {
30171 let len = __tmp.len();
30172 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30173 } else {
30174 __tmp.len()
30175 }
30176 }
30177}
30178#[doc = "Terrain data sent from GCS. The lat/lon and grid_spacing must be the same as a lat/lon from a TERRAIN_REQUEST. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
30179#[doc = ""]
30180#[doc = "ID: 134"]
30181#[derive(Debug, Clone, PartialEq)]
30182#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30183#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30184#[cfg_attr(feature = "ts", derive(TS))]
30185#[cfg_attr(feature = "ts", ts(export))]
30186pub struct TERRAIN_DATA_DATA {
30187 #[doc = "Latitude of SW corner of first grid"]
30188 pub lat: i32,
30189 #[doc = "Longitude of SW corner of first grid"]
30190 pub lon: i32,
30191 #[doc = "Grid spacing"]
30192 pub grid_spacing: u16,
30193 #[doc = "Terrain data MSL"]
30194 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30195 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30196 pub data: [i16; 16],
30197 #[doc = "bit within the terrain request mask"]
30198 pub gridbit: u8,
30199}
30200impl TERRAIN_DATA_DATA {
30201 pub const ENCODED_LEN: usize = 43usize;
30202 pub const DEFAULT: Self = Self {
30203 lat: 0_i32,
30204 lon: 0_i32,
30205 grid_spacing: 0_u16,
30206 data: [0_i16; 16usize],
30207 gridbit: 0_u8,
30208 };
30209 #[cfg(feature = "arbitrary")]
30210 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30211 use arbitrary::{Arbitrary, Unstructured};
30212 let mut buf = [0u8; 1024];
30213 rng.fill_bytes(&mut buf);
30214 let mut unstructured = Unstructured::new(&buf);
30215 Self::arbitrary(&mut unstructured).unwrap_or_default()
30216 }
30217}
30218impl Default for TERRAIN_DATA_DATA {
30219 fn default() -> Self {
30220 Self::DEFAULT.clone()
30221 }
30222}
30223impl MessageData for TERRAIN_DATA_DATA {
30224 type Message = MavMessage;
30225 const ID: u32 = 134u32;
30226 const NAME: &'static str = "TERRAIN_DATA";
30227 const EXTRA_CRC: u8 = 229u8;
30228 const ENCODED_LEN: usize = 43usize;
30229 fn deser(
30230 _version: MavlinkVersion,
30231 __input: &[u8],
30232 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30233 let avail_len = __input.len();
30234 let mut payload_buf = [0; Self::ENCODED_LEN];
30235 let mut buf = if avail_len < Self::ENCODED_LEN {
30236 payload_buf[0..avail_len].copy_from_slice(__input);
30237 Bytes::new(&payload_buf)
30238 } else {
30239 Bytes::new(__input)
30240 };
30241 let mut __struct = Self::default();
30242 __struct.lat = buf.get_i32_le();
30243 __struct.lon = buf.get_i32_le();
30244 __struct.grid_spacing = buf.get_u16_le();
30245 for v in &mut __struct.data {
30246 let val = buf.get_i16_le();
30247 *v = val;
30248 }
30249 __struct.gridbit = buf.get_u8();
30250 Ok(__struct)
30251 }
30252 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30253 let mut __tmp = BytesMut::new(bytes);
30254 #[allow(clippy::absurd_extreme_comparisons)]
30255 #[allow(unused_comparisons)]
30256 if __tmp.remaining() < Self::ENCODED_LEN {
30257 panic!(
30258 "buffer is too small (need {} bytes, but got {})",
30259 Self::ENCODED_LEN,
30260 __tmp.remaining(),
30261 )
30262 }
30263 __tmp.put_i32_le(self.lat);
30264 __tmp.put_i32_le(self.lon);
30265 __tmp.put_u16_le(self.grid_spacing);
30266 for val in &self.data {
30267 __tmp.put_i16_le(*val);
30268 }
30269 __tmp.put_u8(self.gridbit);
30270 if matches!(version, MavlinkVersion::V2) {
30271 let len = __tmp.len();
30272 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30273 } else {
30274 __tmp.len()
30275 }
30276 }
30277}
30278#[doc = "Streamed from drone to report progress of terrain map download (initiated by TERRAIN_REQUEST), or sent as a response to a TERRAIN_CHECK request. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
30279#[doc = ""]
30280#[doc = "ID: 136"]
30281#[derive(Debug, Clone, PartialEq)]
30282#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30283#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30284#[cfg_attr(feature = "ts", derive(TS))]
30285#[cfg_attr(feature = "ts", ts(export))]
30286pub struct TERRAIN_REPORT_DATA {
30287 #[doc = "Latitude"]
30288 pub lat: i32,
30289 #[doc = "Longitude"]
30290 pub lon: i32,
30291 #[doc = "Terrain height MSL"]
30292 pub terrain_height: f32,
30293 #[doc = "Current vehicle height above lat/lon terrain height"]
30294 pub current_height: f32,
30295 #[doc = "grid spacing (zero if terrain at this location unavailable)"]
30296 pub spacing: u16,
30297 #[doc = "Number of 4x4 terrain blocks waiting to be received or read from disk"]
30298 pub pending: u16,
30299 #[doc = "Number of 4x4 terrain blocks in memory"]
30300 pub loaded: u16,
30301}
30302impl TERRAIN_REPORT_DATA {
30303 pub const ENCODED_LEN: usize = 22usize;
30304 pub const DEFAULT: Self = Self {
30305 lat: 0_i32,
30306 lon: 0_i32,
30307 terrain_height: 0.0_f32,
30308 current_height: 0.0_f32,
30309 spacing: 0_u16,
30310 pending: 0_u16,
30311 loaded: 0_u16,
30312 };
30313 #[cfg(feature = "arbitrary")]
30314 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30315 use arbitrary::{Arbitrary, Unstructured};
30316 let mut buf = [0u8; 1024];
30317 rng.fill_bytes(&mut buf);
30318 let mut unstructured = Unstructured::new(&buf);
30319 Self::arbitrary(&mut unstructured).unwrap_or_default()
30320 }
30321}
30322impl Default for TERRAIN_REPORT_DATA {
30323 fn default() -> Self {
30324 Self::DEFAULT.clone()
30325 }
30326}
30327impl MessageData for TERRAIN_REPORT_DATA {
30328 type Message = MavMessage;
30329 const ID: u32 = 136u32;
30330 const NAME: &'static str = "TERRAIN_REPORT";
30331 const EXTRA_CRC: u8 = 1u8;
30332 const ENCODED_LEN: usize = 22usize;
30333 fn deser(
30334 _version: MavlinkVersion,
30335 __input: &[u8],
30336 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30337 let avail_len = __input.len();
30338 let mut payload_buf = [0; Self::ENCODED_LEN];
30339 let mut buf = if avail_len < Self::ENCODED_LEN {
30340 payload_buf[0..avail_len].copy_from_slice(__input);
30341 Bytes::new(&payload_buf)
30342 } else {
30343 Bytes::new(__input)
30344 };
30345 let mut __struct = Self::default();
30346 __struct.lat = buf.get_i32_le();
30347 __struct.lon = buf.get_i32_le();
30348 __struct.terrain_height = buf.get_f32_le();
30349 __struct.current_height = buf.get_f32_le();
30350 __struct.spacing = buf.get_u16_le();
30351 __struct.pending = buf.get_u16_le();
30352 __struct.loaded = buf.get_u16_le();
30353 Ok(__struct)
30354 }
30355 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30356 let mut __tmp = BytesMut::new(bytes);
30357 #[allow(clippy::absurd_extreme_comparisons)]
30358 #[allow(unused_comparisons)]
30359 if __tmp.remaining() < Self::ENCODED_LEN {
30360 panic!(
30361 "buffer is too small (need {} bytes, but got {})",
30362 Self::ENCODED_LEN,
30363 __tmp.remaining(),
30364 )
30365 }
30366 __tmp.put_i32_le(self.lat);
30367 __tmp.put_i32_le(self.lon);
30368 __tmp.put_f32_le(self.terrain_height);
30369 __tmp.put_f32_le(self.current_height);
30370 __tmp.put_u16_le(self.spacing);
30371 __tmp.put_u16_le(self.pending);
30372 __tmp.put_u16_le(self.loaded);
30373 if matches!(version, MavlinkVersion::V2) {
30374 let len = __tmp.len();
30375 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30376 } else {
30377 __tmp.len()
30378 }
30379 }
30380}
30381#[doc = "Request for terrain data and terrain status. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
30382#[doc = ""]
30383#[doc = "ID: 133"]
30384#[derive(Debug, Clone, PartialEq)]
30385#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30386#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30387#[cfg_attr(feature = "ts", derive(TS))]
30388#[cfg_attr(feature = "ts", ts(export))]
30389pub struct TERRAIN_REQUEST_DATA {
30390 #[doc = "Bitmask of requested 4x4 grids (row major 8x7 array of grids, 56 bits)"]
30391 pub mask: u64,
30392 #[doc = "Latitude of SW corner of first grid"]
30393 pub lat: i32,
30394 #[doc = "Longitude of SW corner of first grid"]
30395 pub lon: i32,
30396 #[doc = "Grid spacing"]
30397 pub grid_spacing: u16,
30398}
30399impl TERRAIN_REQUEST_DATA {
30400 pub const ENCODED_LEN: usize = 18usize;
30401 pub const DEFAULT: Self = Self {
30402 mask: 0_u64,
30403 lat: 0_i32,
30404 lon: 0_i32,
30405 grid_spacing: 0_u16,
30406 };
30407 #[cfg(feature = "arbitrary")]
30408 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30409 use arbitrary::{Arbitrary, Unstructured};
30410 let mut buf = [0u8; 1024];
30411 rng.fill_bytes(&mut buf);
30412 let mut unstructured = Unstructured::new(&buf);
30413 Self::arbitrary(&mut unstructured).unwrap_or_default()
30414 }
30415}
30416impl Default for TERRAIN_REQUEST_DATA {
30417 fn default() -> Self {
30418 Self::DEFAULT.clone()
30419 }
30420}
30421impl MessageData for TERRAIN_REQUEST_DATA {
30422 type Message = MavMessage;
30423 const ID: u32 = 133u32;
30424 const NAME: &'static str = "TERRAIN_REQUEST";
30425 const EXTRA_CRC: u8 = 6u8;
30426 const ENCODED_LEN: usize = 18usize;
30427 fn deser(
30428 _version: MavlinkVersion,
30429 __input: &[u8],
30430 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30431 let avail_len = __input.len();
30432 let mut payload_buf = [0; Self::ENCODED_LEN];
30433 let mut buf = if avail_len < Self::ENCODED_LEN {
30434 payload_buf[0..avail_len].copy_from_slice(__input);
30435 Bytes::new(&payload_buf)
30436 } else {
30437 Bytes::new(__input)
30438 };
30439 let mut __struct = Self::default();
30440 __struct.mask = buf.get_u64_le();
30441 __struct.lat = buf.get_i32_le();
30442 __struct.lon = buf.get_i32_le();
30443 __struct.grid_spacing = buf.get_u16_le();
30444 Ok(__struct)
30445 }
30446 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30447 let mut __tmp = BytesMut::new(bytes);
30448 #[allow(clippy::absurd_extreme_comparisons)]
30449 #[allow(unused_comparisons)]
30450 if __tmp.remaining() < Self::ENCODED_LEN {
30451 panic!(
30452 "buffer is too small (need {} bytes, but got {})",
30453 Self::ENCODED_LEN,
30454 __tmp.remaining(),
30455 )
30456 }
30457 __tmp.put_u64_le(self.mask);
30458 __tmp.put_i32_le(self.lat);
30459 __tmp.put_i32_le(self.lon);
30460 __tmp.put_u16_le(self.grid_spacing);
30461 if matches!(version, MavlinkVersion::V2) {
30462 let len = __tmp.len();
30463 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30464 } else {
30465 __tmp.len()
30466 }
30467 }
30468}
30469#[doc = "Time synchronization message. The message is used for both timesync requests and responses. The request is sent with `ts1=syncing component timestamp` and `tc1=0`, and may be broadcast or targeted to a specific system/component. The response is sent with `ts1=syncing component timestamp` (mirror back unchanged), and `tc1=responding component timestamp`, with the `target_system` and `target_component` set to ids of the original request. Systems can determine if they are receiving a request or response based on the value of `tc`. If the response has `target_system==target_component==0` the remote system has not been updated to use the component IDs and cannot reliably timesync; the requestor may report an error. Timestamps are UNIX Epoch time or time since system boot in nanoseconds (the timestamp format can be inferred by checking for the magnitude of the number; generally it doesn't matter as only the offset is used). The message sequence is repeated numerous times with results being filtered/averaged to estimate the offset. See also: <https://mavlink.io/en/services/timesync.html>."]
30470#[doc = ""]
30471#[doc = "ID: 111"]
30472#[derive(Debug, Clone, PartialEq)]
30473#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30474#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30475#[cfg_attr(feature = "ts", derive(TS))]
30476#[cfg_attr(feature = "ts", ts(export))]
30477pub struct TIMESYNC_DATA {
30478 #[doc = "Time sync timestamp 1. Syncing: 0. Responding: Timestamp of responding component."]
30479 pub tc1: i64,
30480 #[doc = "Time sync timestamp 2. Timestamp of syncing component (mirrored in response)."]
30481 pub ts1: i64,
30482 #[doc = "Target system id. Request: 0 (broadcast) or id of specific system. Response must contain system id of the requesting component."]
30483 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30484 pub target_system: u8,
30485 #[doc = "Target component id. Request: 0 (broadcast) or id of specific component. Response must contain component id of the requesting component."]
30486 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30487 pub target_component: u8,
30488}
30489impl TIMESYNC_DATA {
30490 pub const ENCODED_LEN: usize = 18usize;
30491 pub const DEFAULT: Self = Self {
30492 tc1: 0_i64,
30493 ts1: 0_i64,
30494 target_system: 0_u8,
30495 target_component: 0_u8,
30496 };
30497 #[cfg(feature = "arbitrary")]
30498 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30499 use arbitrary::{Arbitrary, Unstructured};
30500 let mut buf = [0u8; 1024];
30501 rng.fill_bytes(&mut buf);
30502 let mut unstructured = Unstructured::new(&buf);
30503 Self::arbitrary(&mut unstructured).unwrap_or_default()
30504 }
30505}
30506impl Default for TIMESYNC_DATA {
30507 fn default() -> Self {
30508 Self::DEFAULT.clone()
30509 }
30510}
30511impl MessageData for TIMESYNC_DATA {
30512 type Message = MavMessage;
30513 const ID: u32 = 111u32;
30514 const NAME: &'static str = "TIMESYNC";
30515 const EXTRA_CRC: u8 = 34u8;
30516 const ENCODED_LEN: usize = 18usize;
30517 fn deser(
30518 _version: MavlinkVersion,
30519 __input: &[u8],
30520 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30521 let avail_len = __input.len();
30522 let mut payload_buf = [0; Self::ENCODED_LEN];
30523 let mut buf = if avail_len < Self::ENCODED_LEN {
30524 payload_buf[0..avail_len].copy_from_slice(__input);
30525 Bytes::new(&payload_buf)
30526 } else {
30527 Bytes::new(__input)
30528 };
30529 let mut __struct = Self::default();
30530 __struct.tc1 = buf.get_i64_le();
30531 __struct.ts1 = buf.get_i64_le();
30532 __struct.target_system = buf.get_u8();
30533 __struct.target_component = buf.get_u8();
30534 Ok(__struct)
30535 }
30536 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30537 let mut __tmp = BytesMut::new(bytes);
30538 #[allow(clippy::absurd_extreme_comparisons)]
30539 #[allow(unused_comparisons)]
30540 if __tmp.remaining() < Self::ENCODED_LEN {
30541 panic!(
30542 "buffer is too small (need {} bytes, but got {})",
30543 Self::ENCODED_LEN,
30544 __tmp.remaining(),
30545 )
30546 }
30547 __tmp.put_i64_le(self.tc1);
30548 __tmp.put_i64_le(self.ts1);
30549 if matches!(version, MavlinkVersion::V2) {
30550 __tmp.put_u8(self.target_system);
30551 __tmp.put_u8(self.target_component);
30552 let len = __tmp.len();
30553 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30554 } else {
30555 __tmp.len()
30556 }
30557 }
30558}
30559#[doc = "Time/duration estimates for various events and actions given the current vehicle state and position."]
30560#[doc = ""]
30561#[doc = "ID: 380"]
30562#[derive(Debug, Clone, PartialEq)]
30563#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30564#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30565#[cfg_attr(feature = "ts", derive(TS))]
30566#[cfg_attr(feature = "ts", ts(export))]
30567pub struct TIME_ESTIMATE_TO_TARGET_DATA {
30568 #[doc = "Estimated time to complete the vehicle's configured \"safe return\" action from its current position (e.g. RTL, Smart RTL, etc.). -1 indicates that the vehicle is landed, or that no time estimate available."]
30569 pub safe_return: i32,
30570 #[doc = "Estimated time for vehicle to complete the LAND action from its current position. -1 indicates that the vehicle is landed, or that no time estimate available."]
30571 pub land: i32,
30572 #[doc = "Estimated time for reaching/completing the currently active mission item. -1 means no time estimate available."]
30573 pub mission_next_item: i32,
30574 #[doc = "Estimated time for completing the current mission. -1 means no mission active and/or no estimate available."]
30575 pub mission_end: i32,
30576 #[doc = "Estimated time for completing the current commanded action (i.e. Go To, Takeoff, Land, etc.). -1 means no action active and/or no estimate available."]
30577 pub commanded_action: i32,
30578}
30579impl TIME_ESTIMATE_TO_TARGET_DATA {
30580 pub const ENCODED_LEN: usize = 20usize;
30581 pub const DEFAULT: Self = Self {
30582 safe_return: 0_i32,
30583 land: 0_i32,
30584 mission_next_item: 0_i32,
30585 mission_end: 0_i32,
30586 commanded_action: 0_i32,
30587 };
30588 #[cfg(feature = "arbitrary")]
30589 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30590 use arbitrary::{Arbitrary, Unstructured};
30591 let mut buf = [0u8; 1024];
30592 rng.fill_bytes(&mut buf);
30593 let mut unstructured = Unstructured::new(&buf);
30594 Self::arbitrary(&mut unstructured).unwrap_or_default()
30595 }
30596}
30597impl Default for TIME_ESTIMATE_TO_TARGET_DATA {
30598 fn default() -> Self {
30599 Self::DEFAULT.clone()
30600 }
30601}
30602impl MessageData for TIME_ESTIMATE_TO_TARGET_DATA {
30603 type Message = MavMessage;
30604 const ID: u32 = 380u32;
30605 const NAME: &'static str = "TIME_ESTIMATE_TO_TARGET";
30606 const EXTRA_CRC: u8 = 232u8;
30607 const ENCODED_LEN: usize = 20usize;
30608 fn deser(
30609 _version: MavlinkVersion,
30610 __input: &[u8],
30611 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30612 let avail_len = __input.len();
30613 let mut payload_buf = [0; Self::ENCODED_LEN];
30614 let mut buf = if avail_len < Self::ENCODED_LEN {
30615 payload_buf[0..avail_len].copy_from_slice(__input);
30616 Bytes::new(&payload_buf)
30617 } else {
30618 Bytes::new(__input)
30619 };
30620 let mut __struct = Self::default();
30621 __struct.safe_return = buf.get_i32_le();
30622 __struct.land = buf.get_i32_le();
30623 __struct.mission_next_item = buf.get_i32_le();
30624 __struct.mission_end = buf.get_i32_le();
30625 __struct.commanded_action = buf.get_i32_le();
30626 Ok(__struct)
30627 }
30628 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30629 let mut __tmp = BytesMut::new(bytes);
30630 #[allow(clippy::absurd_extreme_comparisons)]
30631 #[allow(unused_comparisons)]
30632 if __tmp.remaining() < Self::ENCODED_LEN {
30633 panic!(
30634 "buffer is too small (need {} bytes, but got {})",
30635 Self::ENCODED_LEN,
30636 __tmp.remaining(),
30637 )
30638 }
30639 __tmp.put_i32_le(self.safe_return);
30640 __tmp.put_i32_le(self.land);
30641 __tmp.put_i32_le(self.mission_next_item);
30642 __tmp.put_i32_le(self.mission_end);
30643 __tmp.put_i32_le(self.commanded_action);
30644 if matches!(version, MavlinkVersion::V2) {
30645 let len = __tmp.len();
30646 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30647 } else {
30648 __tmp.len()
30649 }
30650 }
30651}
30652#[doc = "Describe a trajectory using an array of up-to 5 bezier control points in the local frame (MAV_FRAME_LOCAL_NED)."]
30653#[doc = ""]
30654#[doc = "ID: 333"]
30655#[derive(Debug, Clone, PartialEq)]
30656#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30657#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30658#[cfg_attr(feature = "ts", derive(TS))]
30659#[cfg_attr(feature = "ts", ts(export))]
30660pub struct TRAJECTORY_REPRESENTATION_BEZIER_DATA {
30661 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
30662 pub time_usec: u64,
30663 #[doc = "X-coordinate of bezier control points. Set to NaN if not being used"]
30664 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30665 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30666 pub pos_x: [f32; 5],
30667 #[doc = "Y-coordinate of bezier control points. Set to NaN if not being used"]
30668 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30669 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30670 pub pos_y: [f32; 5],
30671 #[doc = "Z-coordinate of bezier control points. Set to NaN if not being used"]
30672 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30673 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30674 pub pos_z: [f32; 5],
30675 #[doc = "Bezier time horizon. Set to NaN if velocity/acceleration should not be incorporated"]
30676 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30677 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30678 pub delta: [f32; 5],
30679 #[doc = "Yaw. Set to NaN for unchanged"]
30680 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30681 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30682 pub pos_yaw: [f32; 5],
30683 #[doc = "Number of valid control points (up-to 5 points are possible)"]
30684 pub valid_points: u8,
30685}
30686impl TRAJECTORY_REPRESENTATION_BEZIER_DATA {
30687 pub const ENCODED_LEN: usize = 109usize;
30688 pub const DEFAULT: Self = Self {
30689 time_usec: 0_u64,
30690 pos_x: [0.0_f32; 5usize],
30691 pos_y: [0.0_f32; 5usize],
30692 pos_z: [0.0_f32; 5usize],
30693 delta: [0.0_f32; 5usize],
30694 pos_yaw: [0.0_f32; 5usize],
30695 valid_points: 0_u8,
30696 };
30697 #[cfg(feature = "arbitrary")]
30698 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30699 use arbitrary::{Arbitrary, Unstructured};
30700 let mut buf = [0u8; 1024];
30701 rng.fill_bytes(&mut buf);
30702 let mut unstructured = Unstructured::new(&buf);
30703 Self::arbitrary(&mut unstructured).unwrap_or_default()
30704 }
30705}
30706impl Default for TRAJECTORY_REPRESENTATION_BEZIER_DATA {
30707 fn default() -> Self {
30708 Self::DEFAULT.clone()
30709 }
30710}
30711impl MessageData for TRAJECTORY_REPRESENTATION_BEZIER_DATA {
30712 type Message = MavMessage;
30713 const ID: u32 = 333u32;
30714 const NAME: &'static str = "TRAJECTORY_REPRESENTATION_BEZIER";
30715 const EXTRA_CRC: u8 = 231u8;
30716 const ENCODED_LEN: usize = 109usize;
30717 fn deser(
30718 _version: MavlinkVersion,
30719 __input: &[u8],
30720 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30721 let avail_len = __input.len();
30722 let mut payload_buf = [0; Self::ENCODED_LEN];
30723 let mut buf = if avail_len < Self::ENCODED_LEN {
30724 payload_buf[0..avail_len].copy_from_slice(__input);
30725 Bytes::new(&payload_buf)
30726 } else {
30727 Bytes::new(__input)
30728 };
30729 let mut __struct = Self::default();
30730 __struct.time_usec = buf.get_u64_le();
30731 for v in &mut __struct.pos_x {
30732 let val = buf.get_f32_le();
30733 *v = val;
30734 }
30735 for v in &mut __struct.pos_y {
30736 let val = buf.get_f32_le();
30737 *v = val;
30738 }
30739 for v in &mut __struct.pos_z {
30740 let val = buf.get_f32_le();
30741 *v = val;
30742 }
30743 for v in &mut __struct.delta {
30744 let val = buf.get_f32_le();
30745 *v = val;
30746 }
30747 for v in &mut __struct.pos_yaw {
30748 let val = buf.get_f32_le();
30749 *v = val;
30750 }
30751 __struct.valid_points = buf.get_u8();
30752 Ok(__struct)
30753 }
30754 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30755 let mut __tmp = BytesMut::new(bytes);
30756 #[allow(clippy::absurd_extreme_comparisons)]
30757 #[allow(unused_comparisons)]
30758 if __tmp.remaining() < Self::ENCODED_LEN {
30759 panic!(
30760 "buffer is too small (need {} bytes, but got {})",
30761 Self::ENCODED_LEN,
30762 __tmp.remaining(),
30763 )
30764 }
30765 __tmp.put_u64_le(self.time_usec);
30766 for val in &self.pos_x {
30767 __tmp.put_f32_le(*val);
30768 }
30769 for val in &self.pos_y {
30770 __tmp.put_f32_le(*val);
30771 }
30772 for val in &self.pos_z {
30773 __tmp.put_f32_le(*val);
30774 }
30775 for val in &self.delta {
30776 __tmp.put_f32_le(*val);
30777 }
30778 for val in &self.pos_yaw {
30779 __tmp.put_f32_le(*val);
30780 }
30781 __tmp.put_u8(self.valid_points);
30782 if matches!(version, MavlinkVersion::V2) {
30783 let len = __tmp.len();
30784 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30785 } else {
30786 __tmp.len()
30787 }
30788 }
30789}
30790#[doc = "Describe a trajectory using an array of up-to 5 waypoints in the local frame (MAV_FRAME_LOCAL_NED)."]
30791#[doc = ""]
30792#[doc = "ID: 332"]
30793#[derive(Debug, Clone, PartialEq)]
30794#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30795#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30796#[cfg_attr(feature = "ts", derive(TS))]
30797#[cfg_attr(feature = "ts", ts(export))]
30798pub struct TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
30799 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
30800 pub time_usec: u64,
30801 #[doc = "X-coordinate of waypoint, set to NaN if not being used"]
30802 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30803 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30804 pub pos_x: [f32; 5],
30805 #[doc = "Y-coordinate of waypoint, set to NaN if not being used"]
30806 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30807 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30808 pub pos_y: [f32; 5],
30809 #[doc = "Z-coordinate of waypoint, set to NaN if not being used"]
30810 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30811 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30812 pub pos_z: [f32; 5],
30813 #[doc = "X-velocity of waypoint, set to NaN if not being used"]
30814 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30815 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30816 pub vel_x: [f32; 5],
30817 #[doc = "Y-velocity of waypoint, set to NaN if not being used"]
30818 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30819 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30820 pub vel_y: [f32; 5],
30821 #[doc = "Z-velocity of waypoint, set to NaN if not being used"]
30822 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30823 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30824 pub vel_z: [f32; 5],
30825 #[doc = "X-acceleration of waypoint, set to NaN if not being used"]
30826 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30827 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30828 pub acc_x: [f32; 5],
30829 #[doc = "Y-acceleration of waypoint, set to NaN if not being used"]
30830 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30831 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30832 pub acc_y: [f32; 5],
30833 #[doc = "Z-acceleration of waypoint, set to NaN if not being used"]
30834 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30835 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30836 pub acc_z: [f32; 5],
30837 #[doc = "Yaw angle, set to NaN if not being used"]
30838 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30839 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30840 pub pos_yaw: [f32; 5],
30841 #[doc = "Yaw rate, set to NaN if not being used"]
30842 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30843 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30844 pub vel_yaw: [f32; 5],
30845 #[doc = "MAV_CMD command id of waypoint, set to UINT16_MAX if not being used."]
30846 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30847 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30848 pub command: [u16; 5],
30849 #[doc = "Number of valid points (up-to 5 waypoints are possible)"]
30850 pub valid_points: u8,
30851}
30852impl TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
30853 pub const ENCODED_LEN: usize = 239usize;
30854 pub const DEFAULT: Self = Self {
30855 time_usec: 0_u64,
30856 pos_x: [0.0_f32; 5usize],
30857 pos_y: [0.0_f32; 5usize],
30858 pos_z: [0.0_f32; 5usize],
30859 vel_x: [0.0_f32; 5usize],
30860 vel_y: [0.0_f32; 5usize],
30861 vel_z: [0.0_f32; 5usize],
30862 acc_x: [0.0_f32; 5usize],
30863 acc_y: [0.0_f32; 5usize],
30864 acc_z: [0.0_f32; 5usize],
30865 pos_yaw: [0.0_f32; 5usize],
30866 vel_yaw: [0.0_f32; 5usize],
30867 command: [0_u16; 5usize],
30868 valid_points: 0_u8,
30869 };
30870 #[cfg(feature = "arbitrary")]
30871 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30872 use arbitrary::{Arbitrary, Unstructured};
30873 let mut buf = [0u8; 1024];
30874 rng.fill_bytes(&mut buf);
30875 let mut unstructured = Unstructured::new(&buf);
30876 Self::arbitrary(&mut unstructured).unwrap_or_default()
30877 }
30878}
30879impl Default for TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
30880 fn default() -> Self {
30881 Self::DEFAULT.clone()
30882 }
30883}
30884impl MessageData for TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
30885 type Message = MavMessage;
30886 const ID: u32 = 332u32;
30887 const NAME: &'static str = "TRAJECTORY_REPRESENTATION_WAYPOINTS";
30888 const EXTRA_CRC: u8 = 236u8;
30889 const ENCODED_LEN: usize = 239usize;
30890 fn deser(
30891 _version: MavlinkVersion,
30892 __input: &[u8],
30893 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30894 let avail_len = __input.len();
30895 let mut payload_buf = [0; Self::ENCODED_LEN];
30896 let mut buf = if avail_len < Self::ENCODED_LEN {
30897 payload_buf[0..avail_len].copy_from_slice(__input);
30898 Bytes::new(&payload_buf)
30899 } else {
30900 Bytes::new(__input)
30901 };
30902 let mut __struct = Self::default();
30903 __struct.time_usec = buf.get_u64_le();
30904 for v in &mut __struct.pos_x {
30905 let val = buf.get_f32_le();
30906 *v = val;
30907 }
30908 for v in &mut __struct.pos_y {
30909 let val = buf.get_f32_le();
30910 *v = val;
30911 }
30912 for v in &mut __struct.pos_z {
30913 let val = buf.get_f32_le();
30914 *v = val;
30915 }
30916 for v in &mut __struct.vel_x {
30917 let val = buf.get_f32_le();
30918 *v = val;
30919 }
30920 for v in &mut __struct.vel_y {
30921 let val = buf.get_f32_le();
30922 *v = val;
30923 }
30924 for v in &mut __struct.vel_z {
30925 let val = buf.get_f32_le();
30926 *v = val;
30927 }
30928 for v in &mut __struct.acc_x {
30929 let val = buf.get_f32_le();
30930 *v = val;
30931 }
30932 for v in &mut __struct.acc_y {
30933 let val = buf.get_f32_le();
30934 *v = val;
30935 }
30936 for v in &mut __struct.acc_z {
30937 let val = buf.get_f32_le();
30938 *v = val;
30939 }
30940 for v in &mut __struct.pos_yaw {
30941 let val = buf.get_f32_le();
30942 *v = val;
30943 }
30944 for v in &mut __struct.vel_yaw {
30945 let val = buf.get_f32_le();
30946 *v = val;
30947 }
30948 for v in &mut __struct.command {
30949 let val = buf.get_u16_le();
30950 *v = val;
30951 }
30952 __struct.valid_points = buf.get_u8();
30953 Ok(__struct)
30954 }
30955 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30956 let mut __tmp = BytesMut::new(bytes);
30957 #[allow(clippy::absurd_extreme_comparisons)]
30958 #[allow(unused_comparisons)]
30959 if __tmp.remaining() < Self::ENCODED_LEN {
30960 panic!(
30961 "buffer is too small (need {} bytes, but got {})",
30962 Self::ENCODED_LEN,
30963 __tmp.remaining(),
30964 )
30965 }
30966 __tmp.put_u64_le(self.time_usec);
30967 for val in &self.pos_x {
30968 __tmp.put_f32_le(*val);
30969 }
30970 for val in &self.pos_y {
30971 __tmp.put_f32_le(*val);
30972 }
30973 for val in &self.pos_z {
30974 __tmp.put_f32_le(*val);
30975 }
30976 for val in &self.vel_x {
30977 __tmp.put_f32_le(*val);
30978 }
30979 for val in &self.vel_y {
30980 __tmp.put_f32_le(*val);
30981 }
30982 for val in &self.vel_z {
30983 __tmp.put_f32_le(*val);
30984 }
30985 for val in &self.acc_x {
30986 __tmp.put_f32_le(*val);
30987 }
30988 for val in &self.acc_y {
30989 __tmp.put_f32_le(*val);
30990 }
30991 for val in &self.acc_z {
30992 __tmp.put_f32_le(*val);
30993 }
30994 for val in &self.pos_yaw {
30995 __tmp.put_f32_le(*val);
30996 }
30997 for val in &self.vel_yaw {
30998 __tmp.put_f32_le(*val);
30999 }
31000 for val in &self.command {
31001 __tmp.put_u16_le(*val);
31002 }
31003 __tmp.put_u8(self.valid_points);
31004 if matches!(version, MavlinkVersion::V2) {
31005 let len = __tmp.len();
31006 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31007 } else {
31008 __tmp.len()
31009 }
31010 }
31011}
31012#[doc = "Message for transporting \"arbitrary\" variable-length data from one component to another (broadcast is not forbidden, but discouraged). The encoding of the data is usually extension specific, i.e. determined by the source, and is usually not documented as part of the MAVLink specification."]
31013#[doc = ""]
31014#[doc = "ID: 385"]
31015#[derive(Debug, Clone, PartialEq)]
31016#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31017#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31018#[cfg_attr(feature = "ts", derive(TS))]
31019#[cfg_attr(feature = "ts", ts(export))]
31020pub struct TUNNEL_DATA {
31021 #[doc = "A code that identifies the content of the payload (0 for unknown, which is the default). If this code is less than 32768, it is a 'registered' payload type and the corresponding code should be added to the MAV_TUNNEL_PAYLOAD_TYPE enum. Software creators can register blocks of types as needed. Codes greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase."]
31022 pub payload_type: MavTunnelPayloadType,
31023 #[doc = "System ID (can be 0 for broadcast, but this is discouraged)"]
31024 pub target_system: u8,
31025 #[doc = "Component ID (can be 0 for broadcast, but this is discouraged)"]
31026 pub target_component: u8,
31027 #[doc = "Length of the data transported in payload"]
31028 pub payload_length: u8,
31029 #[doc = "Variable length payload. The payload length is defined by payload_length. The entire content of this block is opaque unless you understand the encoding specified by payload_type."]
31030 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31031 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31032 pub payload: [u8; 128],
31033}
31034impl TUNNEL_DATA {
31035 pub const ENCODED_LEN: usize = 133usize;
31036 pub const DEFAULT: Self = Self {
31037 payload_type: MavTunnelPayloadType::DEFAULT,
31038 target_system: 0_u8,
31039 target_component: 0_u8,
31040 payload_length: 0_u8,
31041 payload: [0_u8; 128usize],
31042 };
31043 #[cfg(feature = "arbitrary")]
31044 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31045 use arbitrary::{Arbitrary, Unstructured};
31046 let mut buf = [0u8; 1024];
31047 rng.fill_bytes(&mut buf);
31048 let mut unstructured = Unstructured::new(&buf);
31049 Self::arbitrary(&mut unstructured).unwrap_or_default()
31050 }
31051}
31052impl Default for TUNNEL_DATA {
31053 fn default() -> Self {
31054 Self::DEFAULT.clone()
31055 }
31056}
31057impl MessageData for TUNNEL_DATA {
31058 type Message = MavMessage;
31059 const ID: u32 = 385u32;
31060 const NAME: &'static str = "TUNNEL";
31061 const EXTRA_CRC: u8 = 147u8;
31062 const ENCODED_LEN: usize = 133usize;
31063 fn deser(
31064 _version: MavlinkVersion,
31065 __input: &[u8],
31066 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31067 let avail_len = __input.len();
31068 let mut payload_buf = [0; Self::ENCODED_LEN];
31069 let mut buf = if avail_len < Self::ENCODED_LEN {
31070 payload_buf[0..avail_len].copy_from_slice(__input);
31071 Bytes::new(&payload_buf)
31072 } else {
31073 Bytes::new(__input)
31074 };
31075 let mut __struct = Self::default();
31076 let tmp = buf.get_u16_le();
31077 __struct.payload_type = FromPrimitive::from_u16(tmp).ok_or(
31078 ::mavlink_core::error::ParserError::InvalidEnum {
31079 enum_type: "MavTunnelPayloadType",
31080 value: tmp as u32,
31081 },
31082 )?;
31083 __struct.target_system = buf.get_u8();
31084 __struct.target_component = buf.get_u8();
31085 __struct.payload_length = buf.get_u8();
31086 for v in &mut __struct.payload {
31087 let val = buf.get_u8();
31088 *v = val;
31089 }
31090 Ok(__struct)
31091 }
31092 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31093 let mut __tmp = BytesMut::new(bytes);
31094 #[allow(clippy::absurd_extreme_comparisons)]
31095 #[allow(unused_comparisons)]
31096 if __tmp.remaining() < Self::ENCODED_LEN {
31097 panic!(
31098 "buffer is too small (need {} bytes, but got {})",
31099 Self::ENCODED_LEN,
31100 __tmp.remaining(),
31101 )
31102 }
31103 __tmp.put_u16_le(self.payload_type as u16);
31104 __tmp.put_u8(self.target_system);
31105 __tmp.put_u8(self.target_component);
31106 __tmp.put_u8(self.payload_length);
31107 for val in &self.payload {
31108 __tmp.put_u8(*val);
31109 }
31110 if matches!(version, MavlinkVersion::V2) {
31111 let len = __tmp.len();
31112 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31113 } else {
31114 __tmp.len()
31115 }
31116 }
31117}
31118#[doc = "General information describing a particular UAVCAN node. Please refer to the definition of the UAVCAN service \"uavcan.protocol.GetNodeInfo\" for the background information. This message should be emitted by the system whenever a new node appears online, or an existing node reboots. Additionally, it can be emitted upon request from the other end of the MAVLink channel (see MAV_CMD_UAVCAN_GET_NODE_INFO). It is also not prohibited to emit this message unconditionally at a low frequency. The UAVCAN specification is available at <http://uavcan.org>."]
31119#[doc = ""]
31120#[doc = "ID: 311"]
31121#[derive(Debug, Clone, PartialEq)]
31122#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31123#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31124#[cfg_attr(feature = "ts", derive(TS))]
31125#[cfg_attr(feature = "ts", ts(export))]
31126pub struct UAVCAN_NODE_INFO_DATA {
31127 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
31128 pub time_usec: u64,
31129 #[doc = "Time since the start-up of the node."]
31130 pub uptime_sec: u32,
31131 #[doc = "Version control system (VCS) revision identifier (e.g. git short commit hash). 0 if unknown."]
31132 pub sw_vcs_commit: u32,
31133 #[doc = "Node name string. For example, \"sapog.px4.io\"."]
31134 #[cfg_attr(
31135 feature = "serde",
31136 serde(
31137 serialize_with = "crate::nulstr::serialize::<_, 80>",
31138 deserialize_with = "crate::nulstr::deserialize::<_, 80>"
31139 )
31140 )]
31141 #[cfg_attr(feature = "ts", ts(type = "string"))]
31142 pub name: [u8; 80],
31143 #[doc = "Hardware major version number."]
31144 pub hw_version_major: u8,
31145 #[doc = "Hardware minor version number."]
31146 pub hw_version_minor: u8,
31147 #[doc = "Hardware unique 128-bit ID."]
31148 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31149 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31150 pub hw_unique_id: [u8; 16],
31151 #[doc = "Software major version number."]
31152 pub sw_version_major: u8,
31153 #[doc = "Software minor version number."]
31154 pub sw_version_minor: u8,
31155}
31156impl UAVCAN_NODE_INFO_DATA {
31157 pub const ENCODED_LEN: usize = 116usize;
31158 pub const DEFAULT: Self = Self {
31159 time_usec: 0_u64,
31160 uptime_sec: 0_u32,
31161 sw_vcs_commit: 0_u32,
31162 name: [0_u8; 80usize],
31163 hw_version_major: 0_u8,
31164 hw_version_minor: 0_u8,
31165 hw_unique_id: [0_u8; 16usize],
31166 sw_version_major: 0_u8,
31167 sw_version_minor: 0_u8,
31168 };
31169 #[cfg(feature = "arbitrary")]
31170 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31171 use arbitrary::{Arbitrary, Unstructured};
31172 let mut buf = [0u8; 1024];
31173 rng.fill_bytes(&mut buf);
31174 let mut unstructured = Unstructured::new(&buf);
31175 Self::arbitrary(&mut unstructured).unwrap_or_default()
31176 }
31177}
31178impl Default for UAVCAN_NODE_INFO_DATA {
31179 fn default() -> Self {
31180 Self::DEFAULT.clone()
31181 }
31182}
31183impl MessageData for UAVCAN_NODE_INFO_DATA {
31184 type Message = MavMessage;
31185 const ID: u32 = 311u32;
31186 const NAME: &'static str = "UAVCAN_NODE_INFO";
31187 const EXTRA_CRC: u8 = 95u8;
31188 const ENCODED_LEN: usize = 116usize;
31189 fn deser(
31190 _version: MavlinkVersion,
31191 __input: &[u8],
31192 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31193 let avail_len = __input.len();
31194 let mut payload_buf = [0; Self::ENCODED_LEN];
31195 let mut buf = if avail_len < Self::ENCODED_LEN {
31196 payload_buf[0..avail_len].copy_from_slice(__input);
31197 Bytes::new(&payload_buf)
31198 } else {
31199 Bytes::new(__input)
31200 };
31201 let mut __struct = Self::default();
31202 __struct.time_usec = buf.get_u64_le();
31203 __struct.uptime_sec = buf.get_u32_le();
31204 __struct.sw_vcs_commit = buf.get_u32_le();
31205 for v in &mut __struct.name {
31206 let val = buf.get_u8();
31207 *v = val;
31208 }
31209 __struct.hw_version_major = buf.get_u8();
31210 __struct.hw_version_minor = buf.get_u8();
31211 for v in &mut __struct.hw_unique_id {
31212 let val = buf.get_u8();
31213 *v = val;
31214 }
31215 __struct.sw_version_major = buf.get_u8();
31216 __struct.sw_version_minor = buf.get_u8();
31217 Ok(__struct)
31218 }
31219 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31220 let mut __tmp = BytesMut::new(bytes);
31221 #[allow(clippy::absurd_extreme_comparisons)]
31222 #[allow(unused_comparisons)]
31223 if __tmp.remaining() < Self::ENCODED_LEN {
31224 panic!(
31225 "buffer is too small (need {} bytes, but got {})",
31226 Self::ENCODED_LEN,
31227 __tmp.remaining(),
31228 )
31229 }
31230 __tmp.put_u64_le(self.time_usec);
31231 __tmp.put_u32_le(self.uptime_sec);
31232 __tmp.put_u32_le(self.sw_vcs_commit);
31233 for val in &self.name {
31234 __tmp.put_u8(*val);
31235 }
31236 __tmp.put_u8(self.hw_version_major);
31237 __tmp.put_u8(self.hw_version_minor);
31238 for val in &self.hw_unique_id {
31239 __tmp.put_u8(*val);
31240 }
31241 __tmp.put_u8(self.sw_version_major);
31242 __tmp.put_u8(self.sw_version_minor);
31243 if matches!(version, MavlinkVersion::V2) {
31244 let len = __tmp.len();
31245 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31246 } else {
31247 __tmp.len()
31248 }
31249 }
31250}
31251#[doc = "General status information of an UAVCAN node. Please refer to the definition of the UAVCAN message \"uavcan.protocol.NodeStatus\" for the background information. The UAVCAN specification is available at <http://uavcan.org>."]
31252#[doc = ""]
31253#[doc = "ID: 310"]
31254#[derive(Debug, Clone, PartialEq)]
31255#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31256#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31257#[cfg_attr(feature = "ts", derive(TS))]
31258#[cfg_attr(feature = "ts", ts(export))]
31259pub struct UAVCAN_NODE_STATUS_DATA {
31260 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
31261 pub time_usec: u64,
31262 #[doc = "Time since the start-up of the node."]
31263 pub uptime_sec: u32,
31264 #[doc = "Vendor-specific status information."]
31265 pub vendor_specific_status_code: u16,
31266 #[doc = "Generalized node health status."]
31267 pub health: UavcanNodeHealth,
31268 #[doc = "Generalized operating mode."]
31269 pub mode: UavcanNodeMode,
31270 #[doc = "Not used currently."]
31271 pub sub_mode: u8,
31272}
31273impl UAVCAN_NODE_STATUS_DATA {
31274 pub const ENCODED_LEN: usize = 17usize;
31275 pub const DEFAULT: Self = Self {
31276 time_usec: 0_u64,
31277 uptime_sec: 0_u32,
31278 vendor_specific_status_code: 0_u16,
31279 health: UavcanNodeHealth::DEFAULT,
31280 mode: UavcanNodeMode::DEFAULT,
31281 sub_mode: 0_u8,
31282 };
31283 #[cfg(feature = "arbitrary")]
31284 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31285 use arbitrary::{Arbitrary, Unstructured};
31286 let mut buf = [0u8; 1024];
31287 rng.fill_bytes(&mut buf);
31288 let mut unstructured = Unstructured::new(&buf);
31289 Self::arbitrary(&mut unstructured).unwrap_or_default()
31290 }
31291}
31292impl Default for UAVCAN_NODE_STATUS_DATA {
31293 fn default() -> Self {
31294 Self::DEFAULT.clone()
31295 }
31296}
31297impl MessageData for UAVCAN_NODE_STATUS_DATA {
31298 type Message = MavMessage;
31299 const ID: u32 = 310u32;
31300 const NAME: &'static str = "UAVCAN_NODE_STATUS";
31301 const EXTRA_CRC: u8 = 28u8;
31302 const ENCODED_LEN: usize = 17usize;
31303 fn deser(
31304 _version: MavlinkVersion,
31305 __input: &[u8],
31306 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31307 let avail_len = __input.len();
31308 let mut payload_buf = [0; Self::ENCODED_LEN];
31309 let mut buf = if avail_len < Self::ENCODED_LEN {
31310 payload_buf[0..avail_len].copy_from_slice(__input);
31311 Bytes::new(&payload_buf)
31312 } else {
31313 Bytes::new(__input)
31314 };
31315 let mut __struct = Self::default();
31316 __struct.time_usec = buf.get_u64_le();
31317 __struct.uptime_sec = buf.get_u32_le();
31318 __struct.vendor_specific_status_code = buf.get_u16_le();
31319 let tmp = buf.get_u8();
31320 __struct.health =
31321 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31322 enum_type: "UavcanNodeHealth",
31323 value: tmp as u32,
31324 })?;
31325 let tmp = buf.get_u8();
31326 __struct.mode =
31327 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31328 enum_type: "UavcanNodeMode",
31329 value: tmp as u32,
31330 })?;
31331 __struct.sub_mode = buf.get_u8();
31332 Ok(__struct)
31333 }
31334 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31335 let mut __tmp = BytesMut::new(bytes);
31336 #[allow(clippy::absurd_extreme_comparisons)]
31337 #[allow(unused_comparisons)]
31338 if __tmp.remaining() < Self::ENCODED_LEN {
31339 panic!(
31340 "buffer is too small (need {} bytes, but got {})",
31341 Self::ENCODED_LEN,
31342 __tmp.remaining(),
31343 )
31344 }
31345 __tmp.put_u64_le(self.time_usec);
31346 __tmp.put_u32_le(self.uptime_sec);
31347 __tmp.put_u16_le(self.vendor_specific_status_code);
31348 __tmp.put_u8(self.health as u8);
31349 __tmp.put_u8(self.mode as u8);
31350 __tmp.put_u8(self.sub_mode);
31351 if matches!(version, MavlinkVersion::V2) {
31352 let len = __tmp.len();
31353 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31354 } else {
31355 __tmp.len()
31356 }
31357 }
31358}
31359#[doc = "The global position resulting from GPS and sensor fusion."]
31360#[doc = ""]
31361#[doc = "ID: 340"]
31362#[derive(Debug, Clone, PartialEq)]
31363#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31364#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31365#[cfg_attr(feature = "ts", derive(TS))]
31366#[cfg_attr(feature = "ts", ts(export))]
31367pub struct UTM_GLOBAL_POSITION_DATA {
31368 #[doc = "Time of applicability of position (microseconds since UNIX epoch)."]
31369 pub time: u64,
31370 #[doc = "Latitude (WGS84)"]
31371 pub lat: i32,
31372 #[doc = "Longitude (WGS84)"]
31373 pub lon: i32,
31374 #[doc = "Altitude (WGS84)"]
31375 pub alt: i32,
31376 #[doc = "Altitude above ground"]
31377 pub relative_alt: i32,
31378 #[doc = "Next waypoint, latitude (WGS84)"]
31379 pub next_lat: i32,
31380 #[doc = "Next waypoint, longitude (WGS84)"]
31381 pub next_lon: i32,
31382 #[doc = "Next waypoint, altitude (WGS84)"]
31383 pub next_alt: i32,
31384 #[doc = "Ground X speed (latitude, positive north)"]
31385 pub vx: i16,
31386 #[doc = "Ground Y speed (longitude, positive east)"]
31387 pub vy: i16,
31388 #[doc = "Ground Z speed (altitude, positive down)"]
31389 pub vz: i16,
31390 #[doc = "Horizontal position uncertainty (standard deviation)"]
31391 pub h_acc: u16,
31392 #[doc = "Altitude uncertainty (standard deviation)"]
31393 pub v_acc: u16,
31394 #[doc = "Speed uncertainty (standard deviation)"]
31395 pub vel_acc: u16,
31396 #[doc = "Time until next update. Set to 0 if unknown or in data driven mode."]
31397 pub update_rate: u16,
31398 #[doc = "Unique UAS ID."]
31399 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31400 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31401 pub uas_id: [u8; 18],
31402 #[doc = "Flight state"]
31403 pub flight_state: UtmFlightState,
31404 #[doc = "Bitwise OR combination of the data available flags."]
31405 pub flags: UtmDataAvailFlags,
31406}
31407impl UTM_GLOBAL_POSITION_DATA {
31408 pub const ENCODED_LEN: usize = 70usize;
31409 pub const DEFAULT: Self = Self {
31410 time: 0_u64,
31411 lat: 0_i32,
31412 lon: 0_i32,
31413 alt: 0_i32,
31414 relative_alt: 0_i32,
31415 next_lat: 0_i32,
31416 next_lon: 0_i32,
31417 next_alt: 0_i32,
31418 vx: 0_i16,
31419 vy: 0_i16,
31420 vz: 0_i16,
31421 h_acc: 0_u16,
31422 v_acc: 0_u16,
31423 vel_acc: 0_u16,
31424 update_rate: 0_u16,
31425 uas_id: [0_u8; 18usize],
31426 flight_state: UtmFlightState::DEFAULT,
31427 flags: UtmDataAvailFlags::DEFAULT,
31428 };
31429 #[cfg(feature = "arbitrary")]
31430 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31431 use arbitrary::{Arbitrary, Unstructured};
31432 let mut buf = [0u8; 1024];
31433 rng.fill_bytes(&mut buf);
31434 let mut unstructured = Unstructured::new(&buf);
31435 Self::arbitrary(&mut unstructured).unwrap_or_default()
31436 }
31437}
31438impl Default for UTM_GLOBAL_POSITION_DATA {
31439 fn default() -> Self {
31440 Self::DEFAULT.clone()
31441 }
31442}
31443impl MessageData for UTM_GLOBAL_POSITION_DATA {
31444 type Message = MavMessage;
31445 const ID: u32 = 340u32;
31446 const NAME: &'static str = "UTM_GLOBAL_POSITION";
31447 const EXTRA_CRC: u8 = 99u8;
31448 const ENCODED_LEN: usize = 70usize;
31449 fn deser(
31450 _version: MavlinkVersion,
31451 __input: &[u8],
31452 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31453 let avail_len = __input.len();
31454 let mut payload_buf = [0; Self::ENCODED_LEN];
31455 let mut buf = if avail_len < Self::ENCODED_LEN {
31456 payload_buf[0..avail_len].copy_from_slice(__input);
31457 Bytes::new(&payload_buf)
31458 } else {
31459 Bytes::new(__input)
31460 };
31461 let mut __struct = Self::default();
31462 __struct.time = buf.get_u64_le();
31463 __struct.lat = buf.get_i32_le();
31464 __struct.lon = buf.get_i32_le();
31465 __struct.alt = buf.get_i32_le();
31466 __struct.relative_alt = buf.get_i32_le();
31467 __struct.next_lat = buf.get_i32_le();
31468 __struct.next_lon = buf.get_i32_le();
31469 __struct.next_alt = buf.get_i32_le();
31470 __struct.vx = buf.get_i16_le();
31471 __struct.vy = buf.get_i16_le();
31472 __struct.vz = buf.get_i16_le();
31473 __struct.h_acc = buf.get_u16_le();
31474 __struct.v_acc = buf.get_u16_le();
31475 __struct.vel_acc = buf.get_u16_le();
31476 __struct.update_rate = buf.get_u16_le();
31477 for v in &mut __struct.uas_id {
31478 let val = buf.get_u8();
31479 *v = val;
31480 }
31481 let tmp = buf.get_u8();
31482 __struct.flight_state =
31483 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31484 enum_type: "UtmFlightState",
31485 value: tmp as u32,
31486 })?;
31487 let tmp = buf.get_u8();
31488 __struct.flags = UtmDataAvailFlags::from_bits(tmp & UtmDataAvailFlags::all().bits())
31489 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
31490 flag_type: "UtmDataAvailFlags",
31491 value: tmp as u32,
31492 })?;
31493 Ok(__struct)
31494 }
31495 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31496 let mut __tmp = BytesMut::new(bytes);
31497 #[allow(clippy::absurd_extreme_comparisons)]
31498 #[allow(unused_comparisons)]
31499 if __tmp.remaining() < Self::ENCODED_LEN {
31500 panic!(
31501 "buffer is too small (need {} bytes, but got {})",
31502 Self::ENCODED_LEN,
31503 __tmp.remaining(),
31504 )
31505 }
31506 __tmp.put_u64_le(self.time);
31507 __tmp.put_i32_le(self.lat);
31508 __tmp.put_i32_le(self.lon);
31509 __tmp.put_i32_le(self.alt);
31510 __tmp.put_i32_le(self.relative_alt);
31511 __tmp.put_i32_le(self.next_lat);
31512 __tmp.put_i32_le(self.next_lon);
31513 __tmp.put_i32_le(self.next_alt);
31514 __tmp.put_i16_le(self.vx);
31515 __tmp.put_i16_le(self.vy);
31516 __tmp.put_i16_le(self.vz);
31517 __tmp.put_u16_le(self.h_acc);
31518 __tmp.put_u16_le(self.v_acc);
31519 __tmp.put_u16_le(self.vel_acc);
31520 __tmp.put_u16_le(self.update_rate);
31521 for val in &self.uas_id {
31522 __tmp.put_u8(*val);
31523 }
31524 __tmp.put_u8(self.flight_state as u8);
31525 __tmp.put_u8(self.flags.bits());
31526 if matches!(version, MavlinkVersion::V2) {
31527 let len = __tmp.len();
31528 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31529 } else {
31530 __tmp.len()
31531 }
31532 }
31533}
31534#[doc = "Message implementing parts of the V2 payload specs in V1 frames for transitional support."]
31535#[doc = ""]
31536#[doc = "ID: 248"]
31537#[derive(Debug, Clone, PartialEq)]
31538#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31539#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31540#[cfg_attr(feature = "ts", derive(TS))]
31541#[cfg_attr(feature = "ts", ts(export))]
31542pub struct V2_EXTENSION_DATA {
31543 #[doc = "A code that identifies the software component that understands this message (analogous to USB device classes or mime type strings). If this code is less than 32768, it is considered a 'registered' protocol extension and the corresponding entry should be added to <https://github.com/mavlink/mavlink/definition_files/extension_message_ids.xml>. Software creators can register blocks of message IDs as needed (useful for GCS specific metadata, etc...). Message_types greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase."]
31544 pub message_type: u16,
31545 #[doc = "Network ID (0 for broadcast)"]
31546 pub target_network: u8,
31547 #[doc = "System ID (0 for broadcast)"]
31548 pub target_system: u8,
31549 #[doc = "Component ID (0 for broadcast)"]
31550 pub target_component: u8,
31551 #[doc = "Variable length payload. The length must be encoded in the payload as part of the message_type protocol, e.g. by including the length as payload data, or by terminating the payload data with a non-zero marker. This is required in order to reconstruct zero-terminated payloads that are (or otherwise would be) trimmed by MAVLink 2 empty-byte truncation. The entire content of the payload block is opaque unless you understand the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the MAVLink specification."]
31552 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31553 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31554 pub payload: [u8; 249],
31555}
31556impl V2_EXTENSION_DATA {
31557 pub const ENCODED_LEN: usize = 254usize;
31558 pub const DEFAULT: Self = Self {
31559 message_type: 0_u16,
31560 target_network: 0_u8,
31561 target_system: 0_u8,
31562 target_component: 0_u8,
31563 payload: [0_u8; 249usize],
31564 };
31565 #[cfg(feature = "arbitrary")]
31566 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31567 use arbitrary::{Arbitrary, Unstructured};
31568 let mut buf = [0u8; 1024];
31569 rng.fill_bytes(&mut buf);
31570 let mut unstructured = Unstructured::new(&buf);
31571 Self::arbitrary(&mut unstructured).unwrap_or_default()
31572 }
31573}
31574impl Default for V2_EXTENSION_DATA {
31575 fn default() -> Self {
31576 Self::DEFAULT.clone()
31577 }
31578}
31579impl MessageData for V2_EXTENSION_DATA {
31580 type Message = MavMessage;
31581 const ID: u32 = 248u32;
31582 const NAME: &'static str = "V2_EXTENSION";
31583 const EXTRA_CRC: u8 = 8u8;
31584 const ENCODED_LEN: usize = 254usize;
31585 fn deser(
31586 _version: MavlinkVersion,
31587 __input: &[u8],
31588 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31589 let avail_len = __input.len();
31590 let mut payload_buf = [0; Self::ENCODED_LEN];
31591 let mut buf = if avail_len < Self::ENCODED_LEN {
31592 payload_buf[0..avail_len].copy_from_slice(__input);
31593 Bytes::new(&payload_buf)
31594 } else {
31595 Bytes::new(__input)
31596 };
31597 let mut __struct = Self::default();
31598 __struct.message_type = buf.get_u16_le();
31599 __struct.target_network = buf.get_u8();
31600 __struct.target_system = buf.get_u8();
31601 __struct.target_component = buf.get_u8();
31602 for v in &mut __struct.payload {
31603 let val = buf.get_u8();
31604 *v = val;
31605 }
31606 Ok(__struct)
31607 }
31608 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31609 let mut __tmp = BytesMut::new(bytes);
31610 #[allow(clippy::absurd_extreme_comparisons)]
31611 #[allow(unused_comparisons)]
31612 if __tmp.remaining() < Self::ENCODED_LEN {
31613 panic!(
31614 "buffer is too small (need {} bytes, but got {})",
31615 Self::ENCODED_LEN,
31616 __tmp.remaining(),
31617 )
31618 }
31619 __tmp.put_u16_le(self.message_type);
31620 __tmp.put_u8(self.target_network);
31621 __tmp.put_u8(self.target_system);
31622 __tmp.put_u8(self.target_component);
31623 for val in &self.payload {
31624 __tmp.put_u8(*val);
31625 }
31626 if matches!(version, MavlinkVersion::V2) {
31627 let len = __tmp.len();
31628 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31629 } else {
31630 __tmp.len()
31631 }
31632 }
31633}
31634#[doc = "Metrics typically displayed on a HUD for fixed wing aircraft."]
31635#[doc = ""]
31636#[doc = "ID: 74"]
31637#[derive(Debug, Clone, PartialEq)]
31638#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31639#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31640#[cfg_attr(feature = "ts", derive(TS))]
31641#[cfg_attr(feature = "ts", ts(export))]
31642pub struct VFR_HUD_DATA {
31643 #[doc = "Vehicle speed in form appropriate for vehicle type. For standard aircraft this is typically calibrated airspeed (CAS) or indicated airspeed (IAS) - either of which can be used by a pilot to estimate stall speed."]
31644 pub airspeed: f32,
31645 #[doc = "Current ground speed."]
31646 pub groundspeed: f32,
31647 #[doc = "Current altitude (MSL)."]
31648 pub alt: f32,
31649 #[doc = "Current climb rate."]
31650 pub climb: f32,
31651 #[doc = "Current heading in compass units (0-360, 0=north)."]
31652 pub heading: i16,
31653 #[doc = "Current throttle setting (0 to 100)."]
31654 pub throttle: u16,
31655}
31656impl VFR_HUD_DATA {
31657 pub const ENCODED_LEN: usize = 20usize;
31658 pub const DEFAULT: Self = Self {
31659 airspeed: 0.0_f32,
31660 groundspeed: 0.0_f32,
31661 alt: 0.0_f32,
31662 climb: 0.0_f32,
31663 heading: 0_i16,
31664 throttle: 0_u16,
31665 };
31666 #[cfg(feature = "arbitrary")]
31667 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31668 use arbitrary::{Arbitrary, Unstructured};
31669 let mut buf = [0u8; 1024];
31670 rng.fill_bytes(&mut buf);
31671 let mut unstructured = Unstructured::new(&buf);
31672 Self::arbitrary(&mut unstructured).unwrap_or_default()
31673 }
31674}
31675impl Default for VFR_HUD_DATA {
31676 fn default() -> Self {
31677 Self::DEFAULT.clone()
31678 }
31679}
31680impl MessageData for VFR_HUD_DATA {
31681 type Message = MavMessage;
31682 const ID: u32 = 74u32;
31683 const NAME: &'static str = "VFR_HUD";
31684 const EXTRA_CRC: u8 = 20u8;
31685 const ENCODED_LEN: usize = 20usize;
31686 fn deser(
31687 _version: MavlinkVersion,
31688 __input: &[u8],
31689 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31690 let avail_len = __input.len();
31691 let mut payload_buf = [0; Self::ENCODED_LEN];
31692 let mut buf = if avail_len < Self::ENCODED_LEN {
31693 payload_buf[0..avail_len].copy_from_slice(__input);
31694 Bytes::new(&payload_buf)
31695 } else {
31696 Bytes::new(__input)
31697 };
31698 let mut __struct = Self::default();
31699 __struct.airspeed = buf.get_f32_le();
31700 __struct.groundspeed = buf.get_f32_le();
31701 __struct.alt = buf.get_f32_le();
31702 __struct.climb = buf.get_f32_le();
31703 __struct.heading = buf.get_i16_le();
31704 __struct.throttle = buf.get_u16_le();
31705 Ok(__struct)
31706 }
31707 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31708 let mut __tmp = BytesMut::new(bytes);
31709 #[allow(clippy::absurd_extreme_comparisons)]
31710 #[allow(unused_comparisons)]
31711 if __tmp.remaining() < Self::ENCODED_LEN {
31712 panic!(
31713 "buffer is too small (need {} bytes, but got {})",
31714 Self::ENCODED_LEN,
31715 __tmp.remaining(),
31716 )
31717 }
31718 __tmp.put_f32_le(self.airspeed);
31719 __tmp.put_f32_le(self.groundspeed);
31720 __tmp.put_f32_le(self.alt);
31721 __tmp.put_f32_le(self.climb);
31722 __tmp.put_i16_le(self.heading);
31723 __tmp.put_u16_le(self.throttle);
31724 if matches!(version, MavlinkVersion::V2) {
31725 let len = __tmp.len();
31726 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31727 } else {
31728 __tmp.len()
31729 }
31730 }
31731}
31732#[doc = "Vibration levels and accelerometer clipping."]
31733#[doc = ""]
31734#[doc = "ID: 241"]
31735#[derive(Debug, Clone, PartialEq)]
31736#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31737#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31738#[cfg_attr(feature = "ts", derive(TS))]
31739#[cfg_attr(feature = "ts", ts(export))]
31740pub struct VIBRATION_DATA {
31741 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
31742 pub time_usec: u64,
31743 #[doc = "Vibration levels on X-axis"]
31744 pub vibration_x: f32,
31745 #[doc = "Vibration levels on Y-axis"]
31746 pub vibration_y: f32,
31747 #[doc = "Vibration levels on Z-axis"]
31748 pub vibration_z: f32,
31749 #[doc = "first accelerometer clipping count"]
31750 pub clipping_0: u32,
31751 #[doc = "second accelerometer clipping count"]
31752 pub clipping_1: u32,
31753 #[doc = "third accelerometer clipping count"]
31754 pub clipping_2: u32,
31755}
31756impl VIBRATION_DATA {
31757 pub const ENCODED_LEN: usize = 32usize;
31758 pub const DEFAULT: Self = Self {
31759 time_usec: 0_u64,
31760 vibration_x: 0.0_f32,
31761 vibration_y: 0.0_f32,
31762 vibration_z: 0.0_f32,
31763 clipping_0: 0_u32,
31764 clipping_1: 0_u32,
31765 clipping_2: 0_u32,
31766 };
31767 #[cfg(feature = "arbitrary")]
31768 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31769 use arbitrary::{Arbitrary, Unstructured};
31770 let mut buf = [0u8; 1024];
31771 rng.fill_bytes(&mut buf);
31772 let mut unstructured = Unstructured::new(&buf);
31773 Self::arbitrary(&mut unstructured).unwrap_or_default()
31774 }
31775}
31776impl Default for VIBRATION_DATA {
31777 fn default() -> Self {
31778 Self::DEFAULT.clone()
31779 }
31780}
31781impl MessageData for VIBRATION_DATA {
31782 type Message = MavMessage;
31783 const ID: u32 = 241u32;
31784 const NAME: &'static str = "VIBRATION";
31785 const EXTRA_CRC: u8 = 90u8;
31786 const ENCODED_LEN: usize = 32usize;
31787 fn deser(
31788 _version: MavlinkVersion,
31789 __input: &[u8],
31790 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31791 let avail_len = __input.len();
31792 let mut payload_buf = [0; Self::ENCODED_LEN];
31793 let mut buf = if avail_len < Self::ENCODED_LEN {
31794 payload_buf[0..avail_len].copy_from_slice(__input);
31795 Bytes::new(&payload_buf)
31796 } else {
31797 Bytes::new(__input)
31798 };
31799 let mut __struct = Self::default();
31800 __struct.time_usec = buf.get_u64_le();
31801 __struct.vibration_x = buf.get_f32_le();
31802 __struct.vibration_y = buf.get_f32_le();
31803 __struct.vibration_z = buf.get_f32_le();
31804 __struct.clipping_0 = buf.get_u32_le();
31805 __struct.clipping_1 = buf.get_u32_le();
31806 __struct.clipping_2 = buf.get_u32_le();
31807 Ok(__struct)
31808 }
31809 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31810 let mut __tmp = BytesMut::new(bytes);
31811 #[allow(clippy::absurd_extreme_comparisons)]
31812 #[allow(unused_comparisons)]
31813 if __tmp.remaining() < Self::ENCODED_LEN {
31814 panic!(
31815 "buffer is too small (need {} bytes, but got {})",
31816 Self::ENCODED_LEN,
31817 __tmp.remaining(),
31818 )
31819 }
31820 __tmp.put_u64_le(self.time_usec);
31821 __tmp.put_f32_le(self.vibration_x);
31822 __tmp.put_f32_le(self.vibration_y);
31823 __tmp.put_f32_le(self.vibration_z);
31824 __tmp.put_u32_le(self.clipping_0);
31825 __tmp.put_u32_le(self.clipping_1);
31826 __tmp.put_u32_le(self.clipping_2);
31827 if matches!(version, MavlinkVersion::V2) {
31828 let len = __tmp.len();
31829 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31830 } else {
31831 __tmp.len()
31832 }
31833 }
31834}
31835#[doc = "Global position estimate from a Vicon motion system source."]
31836#[doc = ""]
31837#[doc = "ID: 104"]
31838#[derive(Debug, Clone, PartialEq)]
31839#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31840#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31841#[cfg_attr(feature = "ts", derive(TS))]
31842#[cfg_attr(feature = "ts", ts(export))]
31843pub struct VICON_POSITION_ESTIMATE_DATA {
31844 #[doc = "Timestamp (UNIX time or time since system boot)"]
31845 pub usec: u64,
31846 #[doc = "Global X position"]
31847 pub x: f32,
31848 #[doc = "Global Y position"]
31849 pub y: f32,
31850 #[doc = "Global Z position"]
31851 pub z: f32,
31852 #[doc = "Roll angle"]
31853 pub roll: f32,
31854 #[doc = "Pitch angle"]
31855 pub pitch: f32,
31856 #[doc = "Yaw angle"]
31857 pub yaw: f32,
31858 #[doc = "Row-major representation of 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
31859 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31860 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31861 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31862 pub covariance: [f32; 21],
31863}
31864impl VICON_POSITION_ESTIMATE_DATA {
31865 pub const ENCODED_LEN: usize = 116usize;
31866 pub const DEFAULT: Self = Self {
31867 usec: 0_u64,
31868 x: 0.0_f32,
31869 y: 0.0_f32,
31870 z: 0.0_f32,
31871 roll: 0.0_f32,
31872 pitch: 0.0_f32,
31873 yaw: 0.0_f32,
31874 covariance: [0.0_f32; 21usize],
31875 };
31876 #[cfg(feature = "arbitrary")]
31877 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31878 use arbitrary::{Arbitrary, Unstructured};
31879 let mut buf = [0u8; 1024];
31880 rng.fill_bytes(&mut buf);
31881 let mut unstructured = Unstructured::new(&buf);
31882 Self::arbitrary(&mut unstructured).unwrap_or_default()
31883 }
31884}
31885impl Default for VICON_POSITION_ESTIMATE_DATA {
31886 fn default() -> Self {
31887 Self::DEFAULT.clone()
31888 }
31889}
31890impl MessageData for VICON_POSITION_ESTIMATE_DATA {
31891 type Message = MavMessage;
31892 const ID: u32 = 104u32;
31893 const NAME: &'static str = "VICON_POSITION_ESTIMATE";
31894 const EXTRA_CRC: u8 = 56u8;
31895 const ENCODED_LEN: usize = 116usize;
31896 fn deser(
31897 _version: MavlinkVersion,
31898 __input: &[u8],
31899 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31900 let avail_len = __input.len();
31901 let mut payload_buf = [0; Self::ENCODED_LEN];
31902 let mut buf = if avail_len < Self::ENCODED_LEN {
31903 payload_buf[0..avail_len].copy_from_slice(__input);
31904 Bytes::new(&payload_buf)
31905 } else {
31906 Bytes::new(__input)
31907 };
31908 let mut __struct = Self::default();
31909 __struct.usec = buf.get_u64_le();
31910 __struct.x = buf.get_f32_le();
31911 __struct.y = buf.get_f32_le();
31912 __struct.z = buf.get_f32_le();
31913 __struct.roll = buf.get_f32_le();
31914 __struct.pitch = buf.get_f32_le();
31915 __struct.yaw = buf.get_f32_le();
31916 for v in &mut __struct.covariance {
31917 let val = buf.get_f32_le();
31918 *v = val;
31919 }
31920 Ok(__struct)
31921 }
31922 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31923 let mut __tmp = BytesMut::new(bytes);
31924 #[allow(clippy::absurd_extreme_comparisons)]
31925 #[allow(unused_comparisons)]
31926 if __tmp.remaining() < Self::ENCODED_LEN {
31927 panic!(
31928 "buffer is too small (need {} bytes, but got {})",
31929 Self::ENCODED_LEN,
31930 __tmp.remaining(),
31931 )
31932 }
31933 __tmp.put_u64_le(self.usec);
31934 __tmp.put_f32_le(self.x);
31935 __tmp.put_f32_le(self.y);
31936 __tmp.put_f32_le(self.z);
31937 __tmp.put_f32_le(self.roll);
31938 __tmp.put_f32_le(self.pitch);
31939 __tmp.put_f32_le(self.yaw);
31940 if matches!(version, MavlinkVersion::V2) {
31941 for val in &self.covariance {
31942 __tmp.put_f32_le(*val);
31943 }
31944 let len = __tmp.len();
31945 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31946 } else {
31947 __tmp.len()
31948 }
31949 }
31950}
31951#[doc = "Information about video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE, where param2 indicates the video stream id: 0 for all streams, 1 for first, 2 for second, etc."]
31952#[doc = ""]
31953#[doc = "ID: 269"]
31954#[derive(Debug, Clone, PartialEq)]
31955#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31956#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31957#[cfg_attr(feature = "ts", derive(TS))]
31958#[cfg_attr(feature = "ts", ts(export))]
31959pub struct VIDEO_STREAM_INFORMATION_DATA {
31960 #[doc = "Frame rate."]
31961 pub framerate: f32,
31962 #[doc = "Bit rate."]
31963 pub bitrate: u32,
31964 #[doc = "Bitmap of stream status flags."]
31965 pub flags: VideoStreamStatusFlags,
31966 #[doc = "Horizontal resolution."]
31967 pub resolution_h: u16,
31968 #[doc = "Vertical resolution."]
31969 pub resolution_v: u16,
31970 #[doc = "Video image rotation clockwise."]
31971 pub rotation: u16,
31972 #[doc = "Horizontal Field of view."]
31973 pub hfov: u16,
31974 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
31975 pub stream_id: u8,
31976 #[doc = "Number of streams available."]
31977 pub count: u8,
31978 #[doc = "Type of stream."]
31979 pub mavtype: VideoStreamType,
31980 #[doc = "Stream name."]
31981 #[cfg_attr(
31982 feature = "serde",
31983 serde(
31984 serialize_with = "crate::nulstr::serialize::<_, 32>",
31985 deserialize_with = "crate::nulstr::deserialize::<_, 32>"
31986 )
31987 )]
31988 #[cfg_attr(feature = "ts", ts(type = "string"))]
31989 pub name: [u8; 32],
31990 #[doc = "Video stream URI (TCP or RTSP URI ground station should connect to) or port number (UDP port ground station should listen to)."]
31991 #[cfg_attr(
31992 feature = "serde",
31993 serde(
31994 serialize_with = "crate::nulstr::serialize::<_, 160>",
31995 deserialize_with = "crate::nulstr::deserialize::<_, 160>"
31996 )
31997 )]
31998 #[cfg_attr(feature = "ts", ts(type = "string"))]
31999 pub uri: [u8; 160],
32000 #[doc = "Encoding of stream."]
32001 #[cfg_attr(feature = "serde", serde(default))]
32002 pub encoding: VideoStreamEncoding,
32003 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
32004 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
32005 pub camera_device_id: u8,
32006}
32007impl VIDEO_STREAM_INFORMATION_DATA {
32008 pub const ENCODED_LEN: usize = 215usize;
32009 pub const DEFAULT: Self = Self {
32010 framerate: 0.0_f32,
32011 bitrate: 0_u32,
32012 flags: VideoStreamStatusFlags::DEFAULT,
32013 resolution_h: 0_u16,
32014 resolution_v: 0_u16,
32015 rotation: 0_u16,
32016 hfov: 0_u16,
32017 stream_id: 0_u8,
32018 count: 0_u8,
32019 mavtype: VideoStreamType::DEFAULT,
32020 name: [0_u8; 32usize],
32021 uri: [0_u8; 160usize],
32022 encoding: VideoStreamEncoding::DEFAULT,
32023 camera_device_id: 0_u8,
32024 };
32025 #[cfg(feature = "arbitrary")]
32026 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32027 use arbitrary::{Arbitrary, Unstructured};
32028 let mut buf = [0u8; 1024];
32029 rng.fill_bytes(&mut buf);
32030 let mut unstructured = Unstructured::new(&buf);
32031 Self::arbitrary(&mut unstructured).unwrap_or_default()
32032 }
32033}
32034impl Default for VIDEO_STREAM_INFORMATION_DATA {
32035 fn default() -> Self {
32036 Self::DEFAULT.clone()
32037 }
32038}
32039impl MessageData for VIDEO_STREAM_INFORMATION_DATA {
32040 type Message = MavMessage;
32041 const ID: u32 = 269u32;
32042 const NAME: &'static str = "VIDEO_STREAM_INFORMATION";
32043 const EXTRA_CRC: u8 = 109u8;
32044 const ENCODED_LEN: usize = 215usize;
32045 fn deser(
32046 _version: MavlinkVersion,
32047 __input: &[u8],
32048 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32049 let avail_len = __input.len();
32050 let mut payload_buf = [0; Self::ENCODED_LEN];
32051 let mut buf = if avail_len < Self::ENCODED_LEN {
32052 payload_buf[0..avail_len].copy_from_slice(__input);
32053 Bytes::new(&payload_buf)
32054 } else {
32055 Bytes::new(__input)
32056 };
32057 let mut __struct = Self::default();
32058 __struct.framerate = buf.get_f32_le();
32059 __struct.bitrate = buf.get_u32_le();
32060 let tmp = buf.get_u16_le();
32061 __struct.flags = VideoStreamStatusFlags::from_bits(
32062 tmp & VideoStreamStatusFlags::all().bits(),
32063 )
32064 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
32065 flag_type: "VideoStreamStatusFlags",
32066 value: tmp as u32,
32067 })?;
32068 __struct.resolution_h = buf.get_u16_le();
32069 __struct.resolution_v = buf.get_u16_le();
32070 __struct.rotation = buf.get_u16_le();
32071 __struct.hfov = buf.get_u16_le();
32072 __struct.stream_id = buf.get_u8();
32073 __struct.count = buf.get_u8();
32074 let tmp = buf.get_u8();
32075 __struct.mavtype =
32076 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
32077 enum_type: "VideoStreamType",
32078 value: tmp as u32,
32079 })?;
32080 for v in &mut __struct.name {
32081 let val = buf.get_u8();
32082 *v = val;
32083 }
32084 for v in &mut __struct.uri {
32085 let val = buf.get_u8();
32086 *v = val;
32087 }
32088 let tmp = buf.get_u8();
32089 __struct.encoding =
32090 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
32091 enum_type: "VideoStreamEncoding",
32092 value: tmp as u32,
32093 })?;
32094 __struct.camera_device_id = buf.get_u8();
32095 Ok(__struct)
32096 }
32097 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32098 let mut __tmp = BytesMut::new(bytes);
32099 #[allow(clippy::absurd_extreme_comparisons)]
32100 #[allow(unused_comparisons)]
32101 if __tmp.remaining() < Self::ENCODED_LEN {
32102 panic!(
32103 "buffer is too small (need {} bytes, but got {})",
32104 Self::ENCODED_LEN,
32105 __tmp.remaining(),
32106 )
32107 }
32108 __tmp.put_f32_le(self.framerate);
32109 __tmp.put_u32_le(self.bitrate);
32110 __tmp.put_u16_le(self.flags.bits());
32111 __tmp.put_u16_le(self.resolution_h);
32112 __tmp.put_u16_le(self.resolution_v);
32113 __tmp.put_u16_le(self.rotation);
32114 __tmp.put_u16_le(self.hfov);
32115 __tmp.put_u8(self.stream_id);
32116 __tmp.put_u8(self.count);
32117 __tmp.put_u8(self.mavtype as u8);
32118 for val in &self.name {
32119 __tmp.put_u8(*val);
32120 }
32121 for val in &self.uri {
32122 __tmp.put_u8(*val);
32123 }
32124 if matches!(version, MavlinkVersion::V2) {
32125 __tmp.put_u8(self.encoding as u8);
32126 __tmp.put_u8(self.camera_device_id);
32127 let len = __tmp.len();
32128 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32129 } else {
32130 __tmp.len()
32131 }
32132 }
32133}
32134#[doc = "Information about the status of a video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE."]
32135#[doc = ""]
32136#[doc = "ID: 270"]
32137#[derive(Debug, Clone, PartialEq)]
32138#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32139#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32140#[cfg_attr(feature = "ts", derive(TS))]
32141#[cfg_attr(feature = "ts", ts(export))]
32142pub struct VIDEO_STREAM_STATUS_DATA {
32143 #[doc = "Frame rate"]
32144 pub framerate: f32,
32145 #[doc = "Bit rate"]
32146 pub bitrate: u32,
32147 #[doc = "Bitmap of stream status flags"]
32148 pub flags: VideoStreamStatusFlags,
32149 #[doc = "Horizontal resolution"]
32150 pub resolution_h: u16,
32151 #[doc = "Vertical resolution"]
32152 pub resolution_v: u16,
32153 #[doc = "Video image rotation clockwise"]
32154 pub rotation: u16,
32155 #[doc = "Horizontal Field of view"]
32156 pub hfov: u16,
32157 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
32158 pub stream_id: u8,
32159 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
32160 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
32161 pub camera_device_id: u8,
32162}
32163impl VIDEO_STREAM_STATUS_DATA {
32164 pub const ENCODED_LEN: usize = 20usize;
32165 pub const DEFAULT: Self = Self {
32166 framerate: 0.0_f32,
32167 bitrate: 0_u32,
32168 flags: VideoStreamStatusFlags::DEFAULT,
32169 resolution_h: 0_u16,
32170 resolution_v: 0_u16,
32171 rotation: 0_u16,
32172 hfov: 0_u16,
32173 stream_id: 0_u8,
32174 camera_device_id: 0_u8,
32175 };
32176 #[cfg(feature = "arbitrary")]
32177 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32178 use arbitrary::{Arbitrary, Unstructured};
32179 let mut buf = [0u8; 1024];
32180 rng.fill_bytes(&mut buf);
32181 let mut unstructured = Unstructured::new(&buf);
32182 Self::arbitrary(&mut unstructured).unwrap_or_default()
32183 }
32184}
32185impl Default for VIDEO_STREAM_STATUS_DATA {
32186 fn default() -> Self {
32187 Self::DEFAULT.clone()
32188 }
32189}
32190impl MessageData for VIDEO_STREAM_STATUS_DATA {
32191 type Message = MavMessage;
32192 const ID: u32 = 270u32;
32193 const NAME: &'static str = "VIDEO_STREAM_STATUS";
32194 const EXTRA_CRC: u8 = 59u8;
32195 const ENCODED_LEN: usize = 20usize;
32196 fn deser(
32197 _version: MavlinkVersion,
32198 __input: &[u8],
32199 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32200 let avail_len = __input.len();
32201 let mut payload_buf = [0; Self::ENCODED_LEN];
32202 let mut buf = if avail_len < Self::ENCODED_LEN {
32203 payload_buf[0..avail_len].copy_from_slice(__input);
32204 Bytes::new(&payload_buf)
32205 } else {
32206 Bytes::new(__input)
32207 };
32208 let mut __struct = Self::default();
32209 __struct.framerate = buf.get_f32_le();
32210 __struct.bitrate = buf.get_u32_le();
32211 let tmp = buf.get_u16_le();
32212 __struct.flags = VideoStreamStatusFlags::from_bits(
32213 tmp & VideoStreamStatusFlags::all().bits(),
32214 )
32215 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
32216 flag_type: "VideoStreamStatusFlags",
32217 value: tmp as u32,
32218 })?;
32219 __struct.resolution_h = buf.get_u16_le();
32220 __struct.resolution_v = buf.get_u16_le();
32221 __struct.rotation = buf.get_u16_le();
32222 __struct.hfov = buf.get_u16_le();
32223 __struct.stream_id = buf.get_u8();
32224 __struct.camera_device_id = buf.get_u8();
32225 Ok(__struct)
32226 }
32227 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32228 let mut __tmp = BytesMut::new(bytes);
32229 #[allow(clippy::absurd_extreme_comparisons)]
32230 #[allow(unused_comparisons)]
32231 if __tmp.remaining() < Self::ENCODED_LEN {
32232 panic!(
32233 "buffer is too small (need {} bytes, but got {})",
32234 Self::ENCODED_LEN,
32235 __tmp.remaining(),
32236 )
32237 }
32238 __tmp.put_f32_le(self.framerate);
32239 __tmp.put_u32_le(self.bitrate);
32240 __tmp.put_u16_le(self.flags.bits());
32241 __tmp.put_u16_le(self.resolution_h);
32242 __tmp.put_u16_le(self.resolution_v);
32243 __tmp.put_u16_le(self.rotation);
32244 __tmp.put_u16_le(self.hfov);
32245 __tmp.put_u8(self.stream_id);
32246 if matches!(version, MavlinkVersion::V2) {
32247 __tmp.put_u8(self.camera_device_id);
32248 let len = __tmp.len();
32249 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32250 } else {
32251 __tmp.len()
32252 }
32253 }
32254}
32255#[doc = "Local position/attitude estimate from a vision source."]
32256#[doc = ""]
32257#[doc = "ID: 102"]
32258#[derive(Debug, Clone, PartialEq)]
32259#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32260#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32261#[cfg_attr(feature = "ts", derive(TS))]
32262#[cfg_attr(feature = "ts", ts(export))]
32263pub struct VISION_POSITION_ESTIMATE_DATA {
32264 #[doc = "Timestamp (UNIX time or time since system boot)"]
32265 pub usec: u64,
32266 #[doc = "Local X position"]
32267 pub x: f32,
32268 #[doc = "Local Y position"]
32269 pub y: f32,
32270 #[doc = "Local Z position"]
32271 pub z: f32,
32272 #[doc = "Roll angle"]
32273 pub roll: f32,
32274 #[doc = "Pitch angle"]
32275 pub pitch: f32,
32276 #[doc = "Yaw angle"]
32277 pub yaw: f32,
32278 #[doc = "Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
32279 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
32280 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32281 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32282 pub covariance: [f32; 21],
32283 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
32284 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
32285 pub reset_counter: u8,
32286}
32287impl VISION_POSITION_ESTIMATE_DATA {
32288 pub const ENCODED_LEN: usize = 117usize;
32289 pub const DEFAULT: Self = Self {
32290 usec: 0_u64,
32291 x: 0.0_f32,
32292 y: 0.0_f32,
32293 z: 0.0_f32,
32294 roll: 0.0_f32,
32295 pitch: 0.0_f32,
32296 yaw: 0.0_f32,
32297 covariance: [0.0_f32; 21usize],
32298 reset_counter: 0_u8,
32299 };
32300 #[cfg(feature = "arbitrary")]
32301 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32302 use arbitrary::{Arbitrary, Unstructured};
32303 let mut buf = [0u8; 1024];
32304 rng.fill_bytes(&mut buf);
32305 let mut unstructured = Unstructured::new(&buf);
32306 Self::arbitrary(&mut unstructured).unwrap_or_default()
32307 }
32308}
32309impl Default for VISION_POSITION_ESTIMATE_DATA {
32310 fn default() -> Self {
32311 Self::DEFAULT.clone()
32312 }
32313}
32314impl MessageData for VISION_POSITION_ESTIMATE_DATA {
32315 type Message = MavMessage;
32316 const ID: u32 = 102u32;
32317 const NAME: &'static str = "VISION_POSITION_ESTIMATE";
32318 const EXTRA_CRC: u8 = 158u8;
32319 const ENCODED_LEN: usize = 117usize;
32320 fn deser(
32321 _version: MavlinkVersion,
32322 __input: &[u8],
32323 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32324 let avail_len = __input.len();
32325 let mut payload_buf = [0; Self::ENCODED_LEN];
32326 let mut buf = if avail_len < Self::ENCODED_LEN {
32327 payload_buf[0..avail_len].copy_from_slice(__input);
32328 Bytes::new(&payload_buf)
32329 } else {
32330 Bytes::new(__input)
32331 };
32332 let mut __struct = Self::default();
32333 __struct.usec = buf.get_u64_le();
32334 __struct.x = buf.get_f32_le();
32335 __struct.y = buf.get_f32_le();
32336 __struct.z = buf.get_f32_le();
32337 __struct.roll = buf.get_f32_le();
32338 __struct.pitch = buf.get_f32_le();
32339 __struct.yaw = buf.get_f32_le();
32340 for v in &mut __struct.covariance {
32341 let val = buf.get_f32_le();
32342 *v = val;
32343 }
32344 __struct.reset_counter = buf.get_u8();
32345 Ok(__struct)
32346 }
32347 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32348 let mut __tmp = BytesMut::new(bytes);
32349 #[allow(clippy::absurd_extreme_comparisons)]
32350 #[allow(unused_comparisons)]
32351 if __tmp.remaining() < Self::ENCODED_LEN {
32352 panic!(
32353 "buffer is too small (need {} bytes, but got {})",
32354 Self::ENCODED_LEN,
32355 __tmp.remaining(),
32356 )
32357 }
32358 __tmp.put_u64_le(self.usec);
32359 __tmp.put_f32_le(self.x);
32360 __tmp.put_f32_le(self.y);
32361 __tmp.put_f32_le(self.z);
32362 __tmp.put_f32_le(self.roll);
32363 __tmp.put_f32_le(self.pitch);
32364 __tmp.put_f32_le(self.yaw);
32365 if matches!(version, MavlinkVersion::V2) {
32366 for val in &self.covariance {
32367 __tmp.put_f32_le(*val);
32368 }
32369 __tmp.put_u8(self.reset_counter);
32370 let len = __tmp.len();
32371 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32372 } else {
32373 __tmp.len()
32374 }
32375 }
32376}
32377#[doc = "Speed estimate from a vision source."]
32378#[doc = ""]
32379#[doc = "ID: 103"]
32380#[derive(Debug, Clone, PartialEq)]
32381#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32382#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32383#[cfg_attr(feature = "ts", derive(TS))]
32384#[cfg_attr(feature = "ts", ts(export))]
32385pub struct VISION_SPEED_ESTIMATE_DATA {
32386 #[doc = "Timestamp (UNIX time or time since system boot)"]
32387 pub usec: u64,
32388 #[doc = "Global X speed"]
32389 pub x: f32,
32390 #[doc = "Global Y speed"]
32391 pub y: f32,
32392 #[doc = "Global Z speed"]
32393 pub z: f32,
32394 #[doc = "Row-major representation of 3x3 linear velocity covariance matrix (states: vx, vy, vz; 1st three entries - 1st row, etc.). If unknown, assign NaN value to first element in the array."]
32395 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
32396 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32397 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32398 pub covariance: [f32; 9],
32399 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
32400 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
32401 pub reset_counter: u8,
32402}
32403impl VISION_SPEED_ESTIMATE_DATA {
32404 pub const ENCODED_LEN: usize = 57usize;
32405 pub const DEFAULT: Self = Self {
32406 usec: 0_u64,
32407 x: 0.0_f32,
32408 y: 0.0_f32,
32409 z: 0.0_f32,
32410 covariance: [0.0_f32; 9usize],
32411 reset_counter: 0_u8,
32412 };
32413 #[cfg(feature = "arbitrary")]
32414 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32415 use arbitrary::{Arbitrary, Unstructured};
32416 let mut buf = [0u8; 1024];
32417 rng.fill_bytes(&mut buf);
32418 let mut unstructured = Unstructured::new(&buf);
32419 Self::arbitrary(&mut unstructured).unwrap_or_default()
32420 }
32421}
32422impl Default for VISION_SPEED_ESTIMATE_DATA {
32423 fn default() -> Self {
32424 Self::DEFAULT.clone()
32425 }
32426}
32427impl MessageData for VISION_SPEED_ESTIMATE_DATA {
32428 type Message = MavMessage;
32429 const ID: u32 = 103u32;
32430 const NAME: &'static str = "VISION_SPEED_ESTIMATE";
32431 const EXTRA_CRC: u8 = 208u8;
32432 const ENCODED_LEN: usize = 57usize;
32433 fn deser(
32434 _version: MavlinkVersion,
32435 __input: &[u8],
32436 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32437 let avail_len = __input.len();
32438 let mut payload_buf = [0; Self::ENCODED_LEN];
32439 let mut buf = if avail_len < Self::ENCODED_LEN {
32440 payload_buf[0..avail_len].copy_from_slice(__input);
32441 Bytes::new(&payload_buf)
32442 } else {
32443 Bytes::new(__input)
32444 };
32445 let mut __struct = Self::default();
32446 __struct.usec = buf.get_u64_le();
32447 __struct.x = buf.get_f32_le();
32448 __struct.y = buf.get_f32_le();
32449 __struct.z = buf.get_f32_le();
32450 for v in &mut __struct.covariance {
32451 let val = buf.get_f32_le();
32452 *v = val;
32453 }
32454 __struct.reset_counter = buf.get_u8();
32455 Ok(__struct)
32456 }
32457 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32458 let mut __tmp = BytesMut::new(bytes);
32459 #[allow(clippy::absurd_extreme_comparisons)]
32460 #[allow(unused_comparisons)]
32461 if __tmp.remaining() < Self::ENCODED_LEN {
32462 panic!(
32463 "buffer is too small (need {} bytes, but got {})",
32464 Self::ENCODED_LEN,
32465 __tmp.remaining(),
32466 )
32467 }
32468 __tmp.put_u64_le(self.usec);
32469 __tmp.put_f32_le(self.x);
32470 __tmp.put_f32_le(self.y);
32471 __tmp.put_f32_le(self.z);
32472 if matches!(version, MavlinkVersion::V2) {
32473 for val in &self.covariance {
32474 __tmp.put_f32_le(*val);
32475 }
32476 __tmp.put_u8(self.reset_counter);
32477 let len = __tmp.len();
32478 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32479 } else {
32480 __tmp.len()
32481 }
32482 }
32483}
32484#[doc = "Cumulative distance traveled for each reported wheel."]
32485#[doc = ""]
32486#[doc = "ID: 9000"]
32487#[derive(Debug, Clone, PartialEq)]
32488#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32489#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32490#[cfg_attr(feature = "ts", derive(TS))]
32491#[cfg_attr(feature = "ts", ts(export))]
32492pub struct WHEEL_DISTANCE_DATA {
32493 #[doc = "Timestamp (synced to UNIX time or since system boot)."]
32494 pub time_usec: u64,
32495 #[doc = "Distance reported by individual wheel encoders. Forward rotations increase values, reverse rotations decrease them. Not all wheels will necessarily have wheel encoders; the mapping of encoders to wheel positions must be agreed/understood by the endpoints."]
32496 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32497 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32498 pub distance: [f64; 16],
32499 #[doc = "Number of wheels reported."]
32500 pub count: u8,
32501}
32502impl WHEEL_DISTANCE_DATA {
32503 pub const ENCODED_LEN: usize = 137usize;
32504 pub const DEFAULT: Self = Self {
32505 time_usec: 0_u64,
32506 distance: [0.0_f64; 16usize],
32507 count: 0_u8,
32508 };
32509 #[cfg(feature = "arbitrary")]
32510 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32511 use arbitrary::{Arbitrary, Unstructured};
32512 let mut buf = [0u8; 1024];
32513 rng.fill_bytes(&mut buf);
32514 let mut unstructured = Unstructured::new(&buf);
32515 Self::arbitrary(&mut unstructured).unwrap_or_default()
32516 }
32517}
32518impl Default for WHEEL_DISTANCE_DATA {
32519 fn default() -> Self {
32520 Self::DEFAULT.clone()
32521 }
32522}
32523impl MessageData for WHEEL_DISTANCE_DATA {
32524 type Message = MavMessage;
32525 const ID: u32 = 9000u32;
32526 const NAME: &'static str = "WHEEL_DISTANCE";
32527 const EXTRA_CRC: u8 = 113u8;
32528 const ENCODED_LEN: usize = 137usize;
32529 fn deser(
32530 _version: MavlinkVersion,
32531 __input: &[u8],
32532 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32533 let avail_len = __input.len();
32534 let mut payload_buf = [0; Self::ENCODED_LEN];
32535 let mut buf = if avail_len < Self::ENCODED_LEN {
32536 payload_buf[0..avail_len].copy_from_slice(__input);
32537 Bytes::new(&payload_buf)
32538 } else {
32539 Bytes::new(__input)
32540 };
32541 let mut __struct = Self::default();
32542 __struct.time_usec = buf.get_u64_le();
32543 for v in &mut __struct.distance {
32544 let val = buf.get_f64_le();
32545 *v = val;
32546 }
32547 __struct.count = buf.get_u8();
32548 Ok(__struct)
32549 }
32550 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32551 let mut __tmp = BytesMut::new(bytes);
32552 #[allow(clippy::absurd_extreme_comparisons)]
32553 #[allow(unused_comparisons)]
32554 if __tmp.remaining() < Self::ENCODED_LEN {
32555 panic!(
32556 "buffer is too small (need {} bytes, but got {})",
32557 Self::ENCODED_LEN,
32558 __tmp.remaining(),
32559 )
32560 }
32561 __tmp.put_u64_le(self.time_usec);
32562 for val in &self.distance {
32563 __tmp.put_f64_le(*val);
32564 }
32565 __tmp.put_u8(self.count);
32566 if matches!(version, MavlinkVersion::V2) {
32567 let len = __tmp.len();
32568 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32569 } else {
32570 __tmp.len()
32571 }
32572 }
32573}
32574#[doc = "Configure WiFi AP SSID, password, and mode. This message is re-emitted as an acknowledgement by the AP. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
32575#[doc = ""]
32576#[doc = "ID: 299"]
32577#[derive(Debug, Clone, PartialEq)]
32578#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32579#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32580#[cfg_attr(feature = "ts", derive(TS))]
32581#[cfg_attr(feature = "ts", ts(export))]
32582pub struct WIFI_CONFIG_AP_DATA {
32583 #[doc = "Name of Wi-Fi network (SSID). Blank to leave it unchanged when setting. Current SSID when sent back as a response."]
32584 #[cfg_attr(
32585 feature = "serde",
32586 serde(
32587 serialize_with = "crate::nulstr::serialize::<_, 32>",
32588 deserialize_with = "crate::nulstr::deserialize::<_, 32>"
32589 )
32590 )]
32591 #[cfg_attr(feature = "ts", ts(type = "string"))]
32592 pub ssid: [u8; 32],
32593 #[doc = "Password. Blank for an open AP. MD5 hash when message is sent back as a response."]
32594 #[cfg_attr(
32595 feature = "serde",
32596 serde(
32597 serialize_with = "crate::nulstr::serialize::<_, 64>",
32598 deserialize_with = "crate::nulstr::deserialize::<_, 64>"
32599 )
32600 )]
32601 #[cfg_attr(feature = "ts", ts(type = "string"))]
32602 pub password: [u8; 64],
32603 #[doc = "WiFi Mode."]
32604 #[cfg_attr(feature = "serde", serde(default))]
32605 pub mode: WifiConfigApMode,
32606 #[doc = "Message acceptance response (sent back to GS)."]
32607 #[cfg_attr(feature = "serde", serde(default))]
32608 pub response: WifiConfigApResponse,
32609}
32610impl WIFI_CONFIG_AP_DATA {
32611 pub const ENCODED_LEN: usize = 98usize;
32612 pub const DEFAULT: Self = Self {
32613 ssid: [0_u8; 32usize],
32614 password: [0_u8; 64usize],
32615 mode: WifiConfigApMode::DEFAULT,
32616 response: WifiConfigApResponse::DEFAULT,
32617 };
32618 #[cfg(feature = "arbitrary")]
32619 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32620 use arbitrary::{Arbitrary, Unstructured};
32621 let mut buf = [0u8; 1024];
32622 rng.fill_bytes(&mut buf);
32623 let mut unstructured = Unstructured::new(&buf);
32624 Self::arbitrary(&mut unstructured).unwrap_or_default()
32625 }
32626}
32627impl Default for WIFI_CONFIG_AP_DATA {
32628 fn default() -> Self {
32629 Self::DEFAULT.clone()
32630 }
32631}
32632impl MessageData for WIFI_CONFIG_AP_DATA {
32633 type Message = MavMessage;
32634 const ID: u32 = 299u32;
32635 const NAME: &'static str = "WIFI_CONFIG_AP";
32636 const EXTRA_CRC: u8 = 19u8;
32637 const ENCODED_LEN: usize = 98usize;
32638 fn deser(
32639 _version: MavlinkVersion,
32640 __input: &[u8],
32641 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32642 let avail_len = __input.len();
32643 let mut payload_buf = [0; Self::ENCODED_LEN];
32644 let mut buf = if avail_len < Self::ENCODED_LEN {
32645 payload_buf[0..avail_len].copy_from_slice(__input);
32646 Bytes::new(&payload_buf)
32647 } else {
32648 Bytes::new(__input)
32649 };
32650 let mut __struct = Self::default();
32651 for v in &mut __struct.ssid {
32652 let val = buf.get_u8();
32653 *v = val;
32654 }
32655 for v in &mut __struct.password {
32656 let val = buf.get_u8();
32657 *v = val;
32658 }
32659 let tmp = buf.get_i8();
32660 __struct.mode =
32661 FromPrimitive::from_i8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
32662 enum_type: "WifiConfigApMode",
32663 value: tmp as u32,
32664 })?;
32665 let tmp = buf.get_i8();
32666 __struct.response =
32667 FromPrimitive::from_i8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
32668 enum_type: "WifiConfigApResponse",
32669 value: tmp as u32,
32670 })?;
32671 Ok(__struct)
32672 }
32673 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32674 let mut __tmp = BytesMut::new(bytes);
32675 #[allow(clippy::absurd_extreme_comparisons)]
32676 #[allow(unused_comparisons)]
32677 if __tmp.remaining() < Self::ENCODED_LEN {
32678 panic!(
32679 "buffer is too small (need {} bytes, but got {})",
32680 Self::ENCODED_LEN,
32681 __tmp.remaining(),
32682 )
32683 }
32684 for val in &self.ssid {
32685 __tmp.put_u8(*val);
32686 }
32687 for val in &self.password {
32688 __tmp.put_u8(*val);
32689 }
32690 if matches!(version, MavlinkVersion::V2) {
32691 __tmp.put_i8(self.mode as i8);
32692 __tmp.put_i8(self.response as i8);
32693 let len = __tmp.len();
32694 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32695 } else {
32696 __tmp.len()
32697 }
32698 }
32699}
32700#[doc = "Winch status."]
32701#[doc = ""]
32702#[doc = "ID: 9005"]
32703#[derive(Debug, Clone, PartialEq)]
32704#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32705#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32706#[cfg_attr(feature = "ts", derive(TS))]
32707#[cfg_attr(feature = "ts", ts(export))]
32708pub struct WINCH_STATUS_DATA {
32709 #[doc = "Timestamp (synced to UNIX time or since system boot)."]
32710 pub time_usec: u64,
32711 #[doc = "Length of line released. NaN if unknown"]
32712 pub line_length: f32,
32713 #[doc = "Speed line is being released or retracted. Positive values if being released, negative values if being retracted, NaN if unknown"]
32714 pub speed: f32,
32715 #[doc = "Tension on the line. NaN if unknown"]
32716 pub tension: f32,
32717 #[doc = "Voltage of the battery supplying the winch. NaN if unknown"]
32718 pub voltage: f32,
32719 #[doc = "Current draw from the winch. NaN if unknown"]
32720 pub current: f32,
32721 #[doc = "Status flags"]
32722 pub status: MavWinchStatusFlag,
32723 #[doc = "Temperature of the motor. INT16_MAX if unknown"]
32724 pub temperature: i16,
32725}
32726impl WINCH_STATUS_DATA {
32727 pub const ENCODED_LEN: usize = 34usize;
32728 pub const DEFAULT: Self = Self {
32729 time_usec: 0_u64,
32730 line_length: 0.0_f32,
32731 speed: 0.0_f32,
32732 tension: 0.0_f32,
32733 voltage: 0.0_f32,
32734 current: 0.0_f32,
32735 status: MavWinchStatusFlag::DEFAULT,
32736 temperature: 0_i16,
32737 };
32738 #[cfg(feature = "arbitrary")]
32739 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32740 use arbitrary::{Arbitrary, Unstructured};
32741 let mut buf = [0u8; 1024];
32742 rng.fill_bytes(&mut buf);
32743 let mut unstructured = Unstructured::new(&buf);
32744 Self::arbitrary(&mut unstructured).unwrap_or_default()
32745 }
32746}
32747impl Default for WINCH_STATUS_DATA {
32748 fn default() -> Self {
32749 Self::DEFAULT.clone()
32750 }
32751}
32752impl MessageData for WINCH_STATUS_DATA {
32753 type Message = MavMessage;
32754 const ID: u32 = 9005u32;
32755 const NAME: &'static str = "WINCH_STATUS";
32756 const EXTRA_CRC: u8 = 117u8;
32757 const ENCODED_LEN: usize = 34usize;
32758 fn deser(
32759 _version: MavlinkVersion,
32760 __input: &[u8],
32761 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32762 let avail_len = __input.len();
32763 let mut payload_buf = [0; Self::ENCODED_LEN];
32764 let mut buf = if avail_len < Self::ENCODED_LEN {
32765 payload_buf[0..avail_len].copy_from_slice(__input);
32766 Bytes::new(&payload_buf)
32767 } else {
32768 Bytes::new(__input)
32769 };
32770 let mut __struct = Self::default();
32771 __struct.time_usec = buf.get_u64_le();
32772 __struct.line_length = buf.get_f32_le();
32773 __struct.speed = buf.get_f32_le();
32774 __struct.tension = buf.get_f32_le();
32775 __struct.voltage = buf.get_f32_le();
32776 __struct.current = buf.get_f32_le();
32777 let tmp = buf.get_u32_le();
32778 __struct.status = MavWinchStatusFlag::from_bits(tmp & MavWinchStatusFlag::all().bits())
32779 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
32780 flag_type: "MavWinchStatusFlag",
32781 value: tmp as u32,
32782 })?;
32783 __struct.temperature = buf.get_i16_le();
32784 Ok(__struct)
32785 }
32786 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32787 let mut __tmp = BytesMut::new(bytes);
32788 #[allow(clippy::absurd_extreme_comparisons)]
32789 #[allow(unused_comparisons)]
32790 if __tmp.remaining() < Self::ENCODED_LEN {
32791 panic!(
32792 "buffer is too small (need {} bytes, but got {})",
32793 Self::ENCODED_LEN,
32794 __tmp.remaining(),
32795 )
32796 }
32797 __tmp.put_u64_le(self.time_usec);
32798 __tmp.put_f32_le(self.line_length);
32799 __tmp.put_f32_le(self.speed);
32800 __tmp.put_f32_le(self.tension);
32801 __tmp.put_f32_le(self.voltage);
32802 __tmp.put_f32_le(self.current);
32803 __tmp.put_u32_le(self.status.bits());
32804 __tmp.put_i16_le(self.temperature);
32805 if matches!(version, MavlinkVersion::V2) {
32806 let len = __tmp.len();
32807 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32808 } else {
32809 __tmp.len()
32810 }
32811 }
32812}
32813#[doc = "Wind estimate from vehicle. Note that despite the name, this message does not actually contain any covariances but instead variability and accuracy fields in terms of standard deviation (1-STD)."]
32814#[doc = ""]
32815#[doc = "ID: 231"]
32816#[derive(Debug, Clone, PartialEq)]
32817#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32818#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32819#[cfg_attr(feature = "ts", derive(TS))]
32820#[cfg_attr(feature = "ts", ts(export))]
32821pub struct WIND_COV_DATA {
32822 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
32823 pub time_usec: u64,
32824 #[doc = "Wind in North (NED) direction (NAN if unknown)"]
32825 pub wind_x: f32,
32826 #[doc = "Wind in East (NED) direction (NAN if unknown)"]
32827 pub wind_y: f32,
32828 #[doc = "Wind in down (NED) direction (NAN if unknown)"]
32829 pub wind_z: f32,
32830 #[doc = "Variability of wind in XY, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)"]
32831 pub var_horiz: f32,
32832 #[doc = "Variability of wind in Z, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)"]
32833 pub var_vert: f32,
32834 #[doc = "Altitude (MSL) that this measurement was taken at (NAN if unknown)"]
32835 pub wind_alt: f32,
32836 #[doc = "Horizontal speed 1-STD accuracy (0 if unknown)"]
32837 pub horiz_accuracy: f32,
32838 #[doc = "Vertical speed 1-STD accuracy (0 if unknown)"]
32839 pub vert_accuracy: f32,
32840}
32841impl WIND_COV_DATA {
32842 pub const ENCODED_LEN: usize = 40usize;
32843 pub const DEFAULT: Self = Self {
32844 time_usec: 0_u64,
32845 wind_x: 0.0_f32,
32846 wind_y: 0.0_f32,
32847 wind_z: 0.0_f32,
32848 var_horiz: 0.0_f32,
32849 var_vert: 0.0_f32,
32850 wind_alt: 0.0_f32,
32851 horiz_accuracy: 0.0_f32,
32852 vert_accuracy: 0.0_f32,
32853 };
32854 #[cfg(feature = "arbitrary")]
32855 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32856 use arbitrary::{Arbitrary, Unstructured};
32857 let mut buf = [0u8; 1024];
32858 rng.fill_bytes(&mut buf);
32859 let mut unstructured = Unstructured::new(&buf);
32860 Self::arbitrary(&mut unstructured).unwrap_or_default()
32861 }
32862}
32863impl Default for WIND_COV_DATA {
32864 fn default() -> Self {
32865 Self::DEFAULT.clone()
32866 }
32867}
32868impl MessageData for WIND_COV_DATA {
32869 type Message = MavMessage;
32870 const ID: u32 = 231u32;
32871 const NAME: &'static str = "WIND_COV";
32872 const EXTRA_CRC: u8 = 105u8;
32873 const ENCODED_LEN: usize = 40usize;
32874 fn deser(
32875 _version: MavlinkVersion,
32876 __input: &[u8],
32877 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32878 let avail_len = __input.len();
32879 let mut payload_buf = [0; Self::ENCODED_LEN];
32880 let mut buf = if avail_len < Self::ENCODED_LEN {
32881 payload_buf[0..avail_len].copy_from_slice(__input);
32882 Bytes::new(&payload_buf)
32883 } else {
32884 Bytes::new(__input)
32885 };
32886 let mut __struct = Self::default();
32887 __struct.time_usec = buf.get_u64_le();
32888 __struct.wind_x = buf.get_f32_le();
32889 __struct.wind_y = buf.get_f32_le();
32890 __struct.wind_z = buf.get_f32_le();
32891 __struct.var_horiz = buf.get_f32_le();
32892 __struct.var_vert = buf.get_f32_le();
32893 __struct.wind_alt = buf.get_f32_le();
32894 __struct.horiz_accuracy = buf.get_f32_le();
32895 __struct.vert_accuracy = buf.get_f32_le();
32896 Ok(__struct)
32897 }
32898 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32899 let mut __tmp = BytesMut::new(bytes);
32900 #[allow(clippy::absurd_extreme_comparisons)]
32901 #[allow(unused_comparisons)]
32902 if __tmp.remaining() < Self::ENCODED_LEN {
32903 panic!(
32904 "buffer is too small (need {} bytes, but got {})",
32905 Self::ENCODED_LEN,
32906 __tmp.remaining(),
32907 )
32908 }
32909 __tmp.put_u64_le(self.time_usec);
32910 __tmp.put_f32_le(self.wind_x);
32911 __tmp.put_f32_le(self.wind_y);
32912 __tmp.put_f32_le(self.wind_z);
32913 __tmp.put_f32_le(self.var_horiz);
32914 __tmp.put_f32_le(self.var_vert);
32915 __tmp.put_f32_le(self.wind_alt);
32916 __tmp.put_f32_le(self.horiz_accuracy);
32917 __tmp.put_f32_le(self.vert_accuracy);
32918 if matches!(version, MavlinkVersion::V2) {
32919 let len = __tmp.len();
32920 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32921 } else {
32922 __tmp.len()
32923 }
32924 }
32925}
32926#[derive(Clone, PartialEq, Debug)]
32927#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32928#[cfg_attr(feature = "serde", serde(tag = "type"))]
32929#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32930#[cfg_attr(feature = "ts", derive(TS))]
32931#[cfg_attr(feature = "ts", ts(export))]
32932#[repr(u32)]
32933pub enum MavMessage {
32934 #[doc = "Set the vehicle attitude and body angular rates."]
32935 #[doc = ""]
32936 #[doc = "ID: 140"]
32937 ACTUATOR_CONTROL_TARGET(ACTUATOR_CONTROL_TARGET_DATA),
32938 #[doc = "The raw values of the actuator outputs (e.g. on Pixhawk, from MAIN, AUX ports). This message supersedes SERVO_OUTPUT_RAW."]
32939 #[doc = ""]
32940 #[doc = "ID: 375"]
32941 ACTUATOR_OUTPUT_STATUS(ACTUATOR_OUTPUT_STATUS_DATA),
32942 #[doc = "The location and information of an ADSB vehicle."]
32943 #[doc = ""]
32944 #[doc = "ID: 246"]
32945 ADSB_VEHICLE(ADSB_VEHICLE_DATA),
32946 #[doc = "The location and information of an AIS vessel."]
32947 #[doc = ""]
32948 #[doc = "ID: 301"]
32949 AIS_VESSEL(AIS_VESSEL_DATA),
32950 #[doc = "The current system altitude."]
32951 #[doc = ""]
32952 #[doc = "ID: 141"]
32953 ALTITUDE(ALTITUDE_DATA),
32954 #[doc = "The attitude in the aeronautical frame (right-handed, Z-down, Y-right, X-front, ZYX, intrinsic)."]
32955 #[doc = ""]
32956 #[doc = "ID: 30"]
32957 ATTITUDE(ATTITUDE_DATA),
32958 #[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
32959 #[doc = ""]
32960 #[doc = "ID: 31"]
32961 ATTITUDE_QUATERNION(ATTITUDE_QUATERNION_DATA),
32962 #[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
32963 #[doc = ""]
32964 #[doc = "ID: 61"]
32965 ATTITUDE_QUATERNION_COV(ATTITUDE_QUATERNION_COV_DATA),
32966 #[doc = "Reports the current commanded attitude of the vehicle as specified by the autopilot. This should match the commands sent in a SET_ATTITUDE_TARGET message if the vehicle is being controlled this way."]
32967 #[doc = ""]
32968 #[doc = "ID: 83"]
32969 ATTITUDE_TARGET(ATTITUDE_TARGET_DATA),
32970 #[doc = "Motion capture attitude and position."]
32971 #[doc = ""]
32972 #[doc = "ID: 138"]
32973 ATT_POS_MOCAP(ATT_POS_MOCAP_DATA),
32974 #[doc = "Emit an encrypted signature / key identifying this system. PLEASE NOTE: This protocol has been kept simple, so transmitting the key requires an encrypted channel for true safety."]
32975 #[doc = ""]
32976 #[doc = "ID: 7"]
32977 AUTH_KEY(AUTH_KEY_DATA),
32978 #[doc = "Low level message containing autopilot state relevant for a gimbal device. This message is to be sent from the autopilot to the gimbal device component. The data of this message are for the gimbal device's estimator corrections, in particular horizon compensation, as well as indicates autopilot control intentions, e.g. feed forward angular control in the z-axis."]
32979 #[doc = ""]
32980 #[doc = "ID: 286"]
32981 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA),
32982 #[doc = "Version and capability of autopilot software. This should be emitted in response to a request with MAV_CMD_REQUEST_MESSAGE."]
32983 #[doc = ""]
32984 #[doc = "ID: 148"]
32985 AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA),
32986 #[doc = "Information about a flight mode. The message can be enumerated to get information for all modes, or requested for a particular mode, using MAV_CMD_REQUEST_MESSAGE. Specify 0 in param2 to request that the message is emitted for all available modes or the specific index for just one mode. The modes must be available/settable for the current vehicle/frame type. Each mode should only be emitted once (even if it is both standard and custom). Note that the current mode should be emitted in CURRENT_MODE, and that if the mode list can change then AVAILABLE_MODES_MONITOR must be emitted on first change and subsequently streamed. See <https://mavlink.io/en/services/standard_modes.html>."]
32987 #[doc = ""]
32988 #[doc = "ID: 435"]
32989 AVAILABLE_MODES(AVAILABLE_MODES_DATA),
32990 #[doc = "A change to the sequence number indicates that the set of AVAILABLE_MODES has changed. A receiver must re-request all available modes whenever the sequence number changes. This is only emitted after the first change and should then be broadcast at low rate (nominally 0.3 Hz) and on change. See <https://mavlink.io/en/services/standard_modes.html>."]
32991 #[doc = ""]
32992 #[doc = "ID: 437"]
32993 AVAILABLE_MODES_MONITOR(AVAILABLE_MODES_MONITOR_DATA),
32994 #[doc = "Drone IMU data. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
32995 #[doc = ""]
32996 #[doc = "ID: 60052"]
32997 AVSS_DRONE_IMU(AVSS_DRONE_IMU_DATA),
32998 #[doc = "Drone operation mode."]
32999 #[doc = ""]
33000 #[doc = "ID: 60053"]
33001 AVSS_DRONE_OPERATION_MODE(AVSS_DRONE_OPERATION_MODE_DATA),
33002 #[doc = "Drone position."]
33003 #[doc = ""]
33004 #[doc = "ID: 60051"]
33005 AVSS_DRONE_POSITION(AVSS_DRONE_POSITION_DATA),
33006 #[doc = "AVSS PRS system status."]
33007 #[doc = ""]
33008 #[doc = "ID: 60050"]
33009 AVSS_PRS_SYS_STATUS(AVSS_PRS_SYS_STATUS_DATA),
33010 #[doc = "Battery information that is static, or requires infrequent update. This message should requested using MAV_CMD_REQUEST_MESSAGE and/or streamed at very low rate. BATTERY_STATUS_V2 is used for higher-rate battery status information."]
33011 #[doc = ""]
33012 #[doc = "ID: 372"]
33013 BATTERY_INFO(BATTERY_INFO_DATA),
33014 #[doc = "Battery information. Updates GCS with flight controller battery status. Smart batteries also use this message, but may additionally send BATTERY_INFO."]
33015 #[doc = ""]
33016 #[doc = "ID: 147"]
33017 BATTERY_STATUS(BATTERY_STATUS_DATA),
33018 #[doc = "Report button state change."]
33019 #[doc = ""]
33020 #[doc = "ID: 257"]
33021 BUTTON_CHANGE(BUTTON_CHANGE_DATA),
33022 #[doc = "Information about the status of a capture. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
33023 #[doc = ""]
33024 #[doc = "ID: 262"]
33025 CAMERA_CAPTURE_STATUS(CAMERA_CAPTURE_STATUS_DATA),
33026 #[doc = "Information about the field of view of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
33027 #[doc = ""]
33028 #[doc = "ID: 271"]
33029 CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA),
33030 #[doc = "Information about a captured image. This is emitted every time a message is captured. MAV_CMD_REQUEST_MESSAGE can be used to (re)request this message for a specific sequence number or range of sequence numbers: MAV_CMD_REQUEST_MESSAGE.param2 indicates the sequence number the first image to send, or set to -1 to send the message for all sequence numbers. MAV_CMD_REQUEST_MESSAGE.param3 is used to specify a range of messages to send: set to 0 (default) to send just the the message for the sequence number in param 2, set to -1 to send the message for the sequence number in param 2 and all the following sequence numbers, set to the sequence number of the final message in the range."]
33031 #[doc = ""]
33032 #[doc = "ID: 263"]
33033 CAMERA_IMAGE_CAPTURED(CAMERA_IMAGE_CAPTURED_DATA),
33034 #[doc = "Information about a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
33035 #[doc = ""]
33036 #[doc = "ID: 259"]
33037 CAMERA_INFORMATION(CAMERA_INFORMATION_DATA),
33038 #[doc = "Settings of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
33039 #[doc = ""]
33040 #[doc = "ID: 260"]
33041 CAMERA_SETTINGS(CAMERA_SETTINGS_DATA),
33042 #[doc = "Camera absolute thermal range. This can be streamed when the associated VIDEO_STREAM_STATUS `flag` field bit VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED is set, but a GCS may choose to only request it for the current active stream. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval (param3 indicates the stream id of the current camera, or 0 for all streams, param4 indicates the target camera_device_id for autopilot-attached cameras or 0 for MAVLink cameras)."]
33043 #[doc = ""]
33044 #[doc = "ID: 277"]
33045 CAMERA_THERMAL_RANGE(CAMERA_THERMAL_RANGE_DATA),
33046 #[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
33047 #[doc = ""]
33048 #[doc = "ID: 276"]
33049 CAMERA_TRACKING_GEO_STATUS(CAMERA_TRACKING_GEO_STATUS_DATA),
33050 #[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
33051 #[doc = ""]
33052 #[doc = "ID: 275"]
33053 CAMERA_TRACKING_IMAGE_STATUS(CAMERA_TRACKING_IMAGE_STATUS_DATA),
33054 #[doc = "Camera-IMU triggering and synchronisation message."]
33055 #[doc = ""]
33056 #[doc = "ID: 112"]
33057 CAMERA_TRIGGER(CAMERA_TRIGGER_DATA),
33058 #[doc = "A forwarded CANFD frame as requested by MAV_CMD_CAN_FORWARD. These are separated from CAN_FRAME as they need different handling (eg. TAO handling)."]
33059 #[doc = ""]
33060 #[doc = "ID: 387"]
33061 CANFD_FRAME(CANFD_FRAME_DATA),
33062 #[doc = "Modify the filter of what CAN messages to forward over the mavlink. This can be used to make CAN forwarding work well on low bandwidth links. The filtering is applied on bits 8 to 24 of the CAN id (2nd and 3rd bytes) which corresponds to the DroneCAN message ID for DroneCAN. Filters with more than 16 IDs can be constructed by sending multiple CAN_FILTER_MODIFY messages."]
33063 #[doc = ""]
33064 #[doc = "ID: 388"]
33065 CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA),
33066 #[doc = "A forwarded CAN frame as requested by MAV_CMD_CAN_FORWARD."]
33067 #[doc = ""]
33068 #[doc = "ID: 386"]
33069 CAN_FRAME(CAN_FRAME_DATA),
33070 #[doc = "Configure cellular modems. This message is re-emitted as an acknowledgement by the modem. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
33071 #[doc = ""]
33072 #[doc = "ID: 336"]
33073 CELLULAR_CONFIG(CELLULAR_CONFIG_DATA),
33074 #[doc = "Report current used cellular network status."]
33075 #[doc = ""]
33076 #[doc = "ID: 334"]
33077 CELLULAR_STATUS(CELLULAR_STATUS_DATA),
33078 #[doc = "Request to control this MAV."]
33079 #[doc = ""]
33080 #[doc = "ID: 5"]
33081 CHANGE_OPERATOR_CONTROL(CHANGE_OPERATOR_CONTROL_DATA),
33082 #[doc = "Accept / deny control of this MAV."]
33083 #[doc = ""]
33084 #[doc = "ID: 6"]
33085 CHANGE_OPERATOR_CONTROL_ACK(CHANGE_OPERATOR_CONTROL_ACK_DATA),
33086 #[doc = "Information about a potential collision."]
33087 #[doc = ""]
33088 #[doc = "ID: 247"]
33089 COLLISION(COLLISION_DATA),
33090 #[doc = "Report status of a command. Includes feedback whether the command was executed. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
33091 #[doc = ""]
33092 #[doc = "ID: 77"]
33093 COMMAND_ACK(COMMAND_ACK_DATA),
33094 #[doc = "Cancel a long running command. The target system should respond with a COMMAND_ACK to the original command with result=MAV_RESULT_CANCELLED if the long running process was cancelled. If it has already completed, the cancel action can be ignored. The cancel action can be retried until some sort of acknowledgement to the original command has been received. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
33095 #[doc = ""]
33096 #[doc = "ID: 80"]
33097 COMMAND_CANCEL(COMMAND_CANCEL_DATA),
33098 #[doc = "Send a command with up to seven parameters to the MAV, where params 5 and 6 are integers and the other values are floats. This is preferred over COMMAND_LONG as it allows the MAV_FRAME to be specified for interpreting positional information, such as altitude. COMMAND_INT is also preferred when sending latitude and longitude data in params 5 and 6, as it allows for greater precision. Param 5 and 6 encode positional data as scaled integers, where the scaling depends on the actual command value. NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
33099 #[doc = ""]
33100 #[doc = "ID: 75"]
33101 COMMAND_INT(COMMAND_INT_DATA),
33102 #[doc = "Send a command with up to seven parameters to the MAV. COMMAND_INT is generally preferred when sending MAV_CMD commands that include positional information; it offers higher precision and allows the MAV_FRAME to be specified (which may otherwise be ambiguous, particularly for altitude). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
33103 #[doc = ""]
33104 #[doc = "ID: 76"]
33105 COMMAND_LONG(COMMAND_LONG_DATA),
33106 #[doc = "Component information message, which may be requested using MAV_CMD_REQUEST_MESSAGE."]
33107 #[doc = ""]
33108 #[doc = "ID: 395"]
33109 #[deprecated = " See `COMPONENT_METADATA` (Deprecated since 2022-04)"]
33110 COMPONENT_INFORMATION(COMPONENT_INFORMATION_DATA),
33111 #[doc = "Basic component information data. Should be requested using MAV_CMD_REQUEST_MESSAGE on startup, or when required."]
33112 #[doc = ""]
33113 #[doc = "ID: 396"]
33114 COMPONENT_INFORMATION_BASIC(COMPONENT_INFORMATION_BASIC_DATA),
33115 #[doc = "Component metadata message, which may be requested using MAV_CMD_REQUEST_MESSAGE. This contains the MAVLink FTP URI and CRC for the component's general metadata file. The file must be hosted on the component, and may be xz compressed. The file CRC can be used for file caching. The general metadata file can be read to get the locations of other metadata files (COMP_METADATA_TYPE) and translations, which may be hosted either on the vehicle or the internet. For more information see: <https://mavlink.io/en/services/component_information.html>. Note: Camera components should use CAMERA_INFORMATION instead, and autopilots may use both this message and AUTOPILOT_VERSION."]
33116 #[doc = ""]
33117 #[doc = "ID: 397"]
33118 COMPONENT_METADATA(COMPONENT_METADATA_DATA),
33119 #[doc = "The smoothed, monotonic system state used to feed the control loops of the system."]
33120 #[doc = ""]
33121 #[doc = "ID: 146"]
33122 CONTROL_SYSTEM_STATE(CONTROL_SYSTEM_STATE_DATA),
33123 #[doc = "Regular broadcast for the current latest event sequence number for a component. This is used to check for dropped events."]
33124 #[doc = ""]
33125 #[doc = "ID: 411"]
33126 CURRENT_EVENT_SEQUENCE(CURRENT_EVENT_SEQUENCE_DATA),
33127 #[doc = "Get the current mode. This should be emitted on any mode change, and broadcast at low rate (nominally 0.5 Hz). It may be requested using MAV_CMD_REQUEST_MESSAGE. See <https://mavlink.io/en/services/standard_modes.html>."]
33128 #[doc = ""]
33129 #[doc = "ID: 436"]
33130 CURRENT_MODE(CURRENT_MODE_DATA),
33131 #[doc = "Data stream status information."]
33132 #[doc = ""]
33133 #[doc = "ID: 67"]
33134 #[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-08)"]
33135 DATA_STREAM(DATA_STREAM_DATA),
33136 #[doc = "Handshake message to initiate, control and stop image streaming when using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
33137 #[doc = ""]
33138 #[doc = "ID: 130"]
33139 DATA_TRANSMISSION_HANDSHAKE(DATA_TRANSMISSION_HANDSHAKE_DATA),
33140 #[doc = "Send a debug value. The index is used to discriminate between values. These values show up in the plot of QGroundControl as DEBUG N."]
33141 #[doc = ""]
33142 #[doc = "ID: 254"]
33143 DEBUG(DEBUG_DATA),
33144 #[doc = "Large debug/prototyping array. The message uses the maximum available payload for data. The array_id and name fields are used to discriminate between messages in code and in user interfaces (respectively). Do not use in production code."]
33145 #[doc = ""]
33146 #[doc = "ID: 350"]
33147 DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA),
33148 #[doc = "To debug something using a named 3D vector."]
33149 #[doc = ""]
33150 #[doc = "ID: 250"]
33151 DEBUG_VECT(DEBUG_VECT_DATA),
33152 #[doc = "Distance sensor information for an onboard rangefinder."]
33153 #[doc = ""]
33154 #[doc = "ID: 132"]
33155 DISTANCE_SENSOR(DISTANCE_SENSOR_DATA),
33156 #[doc = "EFI status output."]
33157 #[doc = ""]
33158 #[doc = "ID: 225"]
33159 EFI_STATUS(EFI_STATUS_DATA),
33160 #[doc = "Data packet for images sent using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
33161 #[doc = ""]
33162 #[doc = "ID: 131"]
33163 ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA),
33164 #[doc = "ESC information for lower rate streaming. Recommended streaming rate 1Hz. See ESC_STATUS for higher-rate ESC data."]
33165 #[doc = ""]
33166 #[doc = "ID: 290"]
33167 ESC_INFO(ESC_INFO_DATA),
33168 #[doc = "ESC information for higher rate streaming. Recommended streaming rate is ~10 Hz. Information that changes more slowly is sent in ESC_INFO. It should typically only be streamed on high-bandwidth links (i.e. to a companion computer)."]
33169 #[doc = ""]
33170 #[doc = "ID: 291"]
33171 ESC_STATUS(ESC_STATUS_DATA),
33172 #[doc = "Estimator status message including flags, innovation test ratios and estimated accuracies. The flags message is an integer bitmask containing information on which EKF outputs are valid. See the ESTIMATOR_STATUS_FLAGS enum definition for further information. The innovation test ratios show the magnitude of the sensor innovation divided by the innovation check threshold. Under normal operation the innovation test ratios should be below 0.5 with occasional values up to 1.0. Values greater than 1.0 should be rare under normal operation and indicate that a measurement has been rejected by the filter. The user should be notified if an innovation test ratio greater than 1.0 is recorded. Notifications for values in the range between 0.5 and 1.0 should be optional and controllable by the user."]
33173 #[doc = ""]
33174 #[doc = "ID: 230"]
33175 ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA),
33176 #[doc = "Event message. Each new event from a particular component gets a new sequence number. The same message might be sent multiple times if (re-)requested. Most events are broadcast, some can be specific to a target component (as receivers keep track of the sequence for missed events, all events need to be broadcast. Thus we use destination_component instead of target_component)."]
33177 #[doc = ""]
33178 #[doc = "ID: 410"]
33179 EVENT(EVENT_DATA),
33180 #[doc = "Provides state for additional features."]
33181 #[doc = ""]
33182 #[doc = "ID: 245"]
33183 EXTENDED_SYS_STATE(EXTENDED_SYS_STATE_DATA),
33184 #[doc = "Status of geo-fencing. Sent in extended status stream when fencing enabled."]
33185 #[doc = ""]
33186 #[doc = "ID: 162"]
33187 FENCE_STATUS(FENCE_STATUS_DATA),
33188 #[doc = "File transfer protocol message: <https://mavlink.io/en/services/ftp.html>."]
33189 #[doc = ""]
33190 #[doc = "ID: 110"]
33191 FILE_TRANSFER_PROTOCOL(FILE_TRANSFER_PROTOCOL_DATA),
33192 #[doc = "Flight information. This includes time since boot for arm, takeoff, and land, and a flight number. Takeoff and landing values reset to zero on arm. This can be requested using MAV_CMD_REQUEST_MESSAGE. Note, some fields are misnamed - timestamps are from boot (not UTC) and the flight_uuid is a sequence number."]
33193 #[doc = ""]
33194 #[doc = "ID: 264"]
33195 FLIGHT_INFORMATION(FLIGHT_INFORMATION_DATA),
33196 #[doc = "Current motion information from a designated system."]
33197 #[doc = ""]
33198 #[doc = "ID: 144"]
33199 FOLLOW_TARGET(FOLLOW_TARGET_DATA),
33200 #[doc = "Fuel status. This message provides \"generic\" fuel level information for in a GCS and for triggering failsafes in an autopilot. The fuel type and associated units for fields in this message are defined in the enum MAV_FUEL_TYPE. The reported `consumed_fuel` and `remaining_fuel` must only be supplied if measured: they must not be inferred from the `maximum_fuel` and the other value. A recipient can assume that if these fields are supplied they are accurate. If not provided, the recipient can infer `remaining_fuel` from `maximum_fuel` and `consumed_fuel` on the assumption that the fuel was initially at its maximum (this is what battery monitors assume). Note however that this is an assumption, and the UI should prompt the user appropriately (i.e. notify user that they should fill the tank before boot). This kind of information may also be sent in fuel-specific messages such as BATTERY_STATUS_V2. If both messages are sent for the same fuel system, the ids and corresponding information must match. This should be streamed (nominally at 0.1 Hz)."]
33201 #[doc = ""]
33202 #[doc = "ID: 371"]
33203 FUEL_STATUS(FUEL_STATUS_DATA),
33204 #[doc = "Telemetry of power generation system. Alternator or mechanical generator."]
33205 #[doc = ""]
33206 #[doc = "ID: 373"]
33207 GENERATOR_STATUS(GENERATOR_STATUS_DATA),
33208 #[doc = "Message reporting the status of a gimbal device. \t This message should be broadcast by a gimbal device component at a low regular rate (e.g. 5 Hz). \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Other conditions of the flags are not allowed. \t The quaternion and angular velocities in the other frame can be calculated from delta_yaw and delta_yaw_velocity as \t q_earth = q_delta_yaw * q_vehicle and w_earth = w_delta_yaw_velocity + w_vehicle (if not NaN). \t If neither the GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME nor the GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME flag is set, \t then (for backwards compatibility) the data in the delta_yaw and delta_yaw_velocity fields are to be ignored. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME, \t and always should set delta_yaw and delta_yaw_velocity either to the proper value or NaN."]
33209 #[doc = ""]
33210 #[doc = "ID: 285"]
33211 GIMBAL_DEVICE_ATTITUDE_STATUS(GIMBAL_DEVICE_ATTITUDE_STATUS_DATA),
33212 #[doc = "Information about a low level gimbal. This message should be requested by the gimbal manager or a ground station using MAV_CMD_REQUEST_MESSAGE. The maximum angles and rates are the limits by hardware. However, the limits by software used are likely different/smaller and dependent on mode/settings/etc.."]
33213 #[doc = ""]
33214 #[doc = "ID: 283"]
33215 GIMBAL_DEVICE_INFORMATION(GIMBAL_DEVICE_INFORMATION_DATA),
33216 #[doc = "Low level message to control a gimbal device's attitude. \t This message is to be sent from the gimbal manager to the gimbal device component. \t The quaternion and angular velocities can be set to NaN according to use case. \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Setting both GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME and GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is not allowed. \t These rules are to ensure backwards compatibility. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."]
33217 #[doc = ""]
33218 #[doc = "ID: 284"]
33219 GIMBAL_DEVICE_SET_ATTITUDE(GIMBAL_DEVICE_SET_ATTITUDE_DATA),
33220 #[doc = "Information about a high level gimbal manager. This message should be requested by a ground station using MAV_CMD_REQUEST_MESSAGE."]
33221 #[doc = ""]
33222 #[doc = "ID: 280"]
33223 GIMBAL_MANAGER_INFORMATION(GIMBAL_MANAGER_INFORMATION_DATA),
33224 #[doc = "High level message to control a gimbal's attitude. This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
33225 #[doc = ""]
33226 #[doc = "ID: 282"]
33227 GIMBAL_MANAGER_SET_ATTITUDE(GIMBAL_MANAGER_SET_ATTITUDE_DATA),
33228 #[doc = "High level message to control a gimbal manually. The angles or angular rates are unitless; the actual rates will depend on internal gimbal manager settings/configuration (e.g. set by parameters). This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
33229 #[doc = ""]
33230 #[doc = "ID: 288"]
33231 GIMBAL_MANAGER_SET_MANUAL_CONTROL(GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA),
33232 #[doc = "Set gimbal manager pitch and yaw angles (high rate message). This message is to be sent to the gimbal manager (e.g. from a ground station) and will be ignored by gimbal devices. Angles and rates can be set to NaN according to use case. Use MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW for low-rate adjustments that require confirmation."]
33233 #[doc = ""]
33234 #[doc = "ID: 287"]
33235 GIMBAL_MANAGER_SET_PITCHYAW(GIMBAL_MANAGER_SET_PITCHYAW_DATA),
33236 #[doc = "Current status about a high level gimbal manager. This message should be broadcast at a low regular rate (e.g. 5Hz)."]
33237 #[doc = ""]
33238 #[doc = "ID: 281"]
33239 GIMBAL_MANAGER_STATUS(GIMBAL_MANAGER_STATUS_DATA),
33240 #[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient."]
33241 #[doc = ""]
33242 #[doc = "ID: 33"]
33243 GLOBAL_POSITION_INT(GLOBAL_POSITION_INT_DATA),
33244 #[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient. NOTE: This message is intended for onboard networks / companion computers and higher-bandwidth links and optimized for accuracy and completeness. Please use the GLOBAL_POSITION_INT message for a minimal subset."]
33245 #[doc = ""]
33246 #[doc = "ID: 63"]
33247 GLOBAL_POSITION_INT_COV(GLOBAL_POSITION_INT_COV_DATA),
33248 #[doc = "Global position/attitude estimate from a vision source."]
33249 #[doc = ""]
33250 #[doc = "ID: 101"]
33251 GLOBAL_VISION_POSITION_ESTIMATE(GLOBAL_VISION_POSITION_ESTIMATE_DATA),
33252 #[doc = "Second GPS data."]
33253 #[doc = ""]
33254 #[doc = "ID: 124"]
33255 GPS2_RAW(GPS2_RAW_DATA),
33256 #[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
33257 #[doc = ""]
33258 #[doc = "ID: 128"]
33259 GPS2_RTK(GPS2_RTK_DATA),
33260 #[doc = "Publishes the GPS coordinates of the vehicle local origin (0,0,0) position. Emitted whenever a new GPS-Local position mapping is requested or set - e.g. following SET_GPS_GLOBAL_ORIGIN message."]
33261 #[doc = ""]
33262 #[doc = "ID: 49"]
33263 GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA),
33264 #[doc = "Data for injecting into the onboard GPS (used for DGPS)."]
33265 #[doc = ""]
33266 #[doc = "ID: 123"]
33267 #[deprecated = " See `GPS_RTCM_DATA` (Deprecated since 2022-05)"]
33268 GPS_INJECT_DATA(GPS_INJECT_DATA_DATA),
33269 #[doc = "GPS sensor input message. This is a raw sensor value sent by the GPS. This is NOT the global position estimate of the system."]
33270 #[doc = ""]
33271 #[doc = "ID: 232"]
33272 GPS_INPUT(GPS_INPUT_DATA),
33273 #[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
33274 #[doc = ""]
33275 #[doc = "ID: 24"]
33276 GPS_RAW_INT(GPS_RAW_INT_DATA),
33277 #[doc = "RTCM message for injecting into the onboard GPS (used for DGPS)."]
33278 #[doc = ""]
33279 #[doc = "ID: 233"]
33280 GPS_RTCM_DATA(GPS_RTCM_DATA_DATA),
33281 #[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
33282 #[doc = ""]
33283 #[doc = "ID: 127"]
33284 GPS_RTK(GPS_RTK_DATA),
33285 #[doc = "The positioning status, as reported by GPS. This message is intended to display status information about each satellite visible to the receiver. See message GLOBAL_POSITION_INT for the global position estimate. This message can contain information for up to 20 satellites."]
33286 #[doc = ""]
33287 #[doc = "ID: 25"]
33288 GPS_STATUS(GPS_STATUS_DATA),
33289 #[doc = "The heartbeat message shows that a system or component is present and responding. The type and autopilot fields (along with the message component id), allow the receiving system to treat further messages from this system appropriately (e.g. by laying out the user interface based on the autopilot). This microservice is documented at <https://mavlink.io/en/services/heartbeat.html>."]
33290 #[doc = ""]
33291 #[doc = "ID: 0"]
33292 HEARTBEAT(HEARTBEAT_DATA),
33293 #[doc = "The IMU readings in SI units in NED body frame."]
33294 #[doc = ""]
33295 #[doc = "ID: 105"]
33296 HIGHRES_IMU(HIGHRES_IMU_DATA),
33297 #[doc = "Message appropriate for high latency connections like Iridium."]
33298 #[doc = ""]
33299 #[doc = "ID: 234"]
33300 #[deprecated = " See `HIGH_LATENCY2` (Deprecated since 2020-10)"]
33301 HIGH_LATENCY(HIGH_LATENCY_DATA),
33302 #[doc = "Message appropriate for high latency connections like Iridium (version 2)."]
33303 #[doc = ""]
33304 #[doc = "ID: 235"]
33305 HIGH_LATENCY2(HIGH_LATENCY2_DATA),
33306 #[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_CONTROLS."]
33307 #[doc = ""]
33308 #[doc = "ID: 93"]
33309 HIL_ACTUATOR_CONTROLS(HIL_ACTUATOR_CONTROLS_DATA),
33310 #[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_ACTUATOR_CONTROLS."]
33311 #[doc = ""]
33312 #[doc = "ID: 91"]
33313 HIL_CONTROLS(HIL_CONTROLS_DATA),
33314 #[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
33315 #[doc = ""]
33316 #[doc = "ID: 113"]
33317 HIL_GPS(HIL_GPS_DATA),
33318 #[doc = "Simulated optical flow from a flow sensor (e.g. PX4FLOW or optical mouse sensor)."]
33319 #[doc = ""]
33320 #[doc = "ID: 114"]
33321 HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA),
33322 #[doc = "Sent from simulation to autopilot. The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification."]
33323 #[doc = ""]
33324 #[doc = "ID: 92"]
33325 HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA),
33326 #[doc = "The IMU readings in SI units in NED body frame."]
33327 #[doc = ""]
33328 #[doc = "ID: 107"]
33329 HIL_SENSOR(HIL_SENSOR_DATA),
33330 #[doc = "Sent from simulation to autopilot. This packet is useful for high throughput applications such as hardware in the loop simulations."]
33331 #[doc = ""]
33332 #[doc = "ID: 90"]
33333 #[deprecated = "Suffers from missing airspeed fields and singularities due to Euler angles. See `HIL_STATE_QUATERNION` (Deprecated since 2013-07)"]
33334 HIL_STATE(HIL_STATE_DATA),
33335 #[doc = "Sent from simulation to autopilot, avoids in contrast to HIL_STATE singularities. This packet is useful for high throughput applications such as hardware in the loop simulations."]
33336 #[doc = ""]
33337 #[doc = "ID: 115"]
33338 HIL_STATE_QUATERNION(HIL_STATE_QUATERNION_DATA),
33339 #[doc = "Contains the home position. \tThe home position is the default position that the system will return to and land on. \tThe position must be set automatically by the system during the takeoff, and may also be explicitly set using MAV_CMD_DO_SET_HOME. \tThe global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. \tUnder normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. \tThe approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: this message can be requested by sending the MAV_CMD_REQUEST_MESSAGE with param1=242 (or the deprecated MAV_CMD_GET_HOME_POSITION command)."]
33340 #[doc = ""]
33341 #[doc = "ID: 242"]
33342 HOME_POSITION(HOME_POSITION_DATA),
33343 #[doc = "Temperature and humidity from hygrometer."]
33344 #[doc = ""]
33345 #[doc = "ID: 12920"]
33346 HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA),
33347 #[doc = "Illuminator status."]
33348 #[doc = ""]
33349 #[doc = "ID: 440"]
33350 ILLUMINATOR_STATUS(ILLUMINATOR_STATUS_DATA),
33351 #[doc = "Status of the Iridium SBD link."]
33352 #[doc = ""]
33353 #[doc = "ID: 335"]
33354 ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA),
33355 #[doc = "The location of a landing target. See: <https://mavlink.io/en/services/landing_target.html>."]
33356 #[doc = ""]
33357 #[doc = "ID: 149"]
33358 LANDING_TARGET(LANDING_TARGET_DATA),
33359 #[doc = "Status generated in each node in the communication chain and injected into MAVLink stream."]
33360 #[doc = ""]
33361 #[doc = "ID: 8"]
33362 LINK_NODE_STATUS(LINK_NODE_STATUS_DATA),
33363 #[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
33364 #[doc = ""]
33365 #[doc = "ID: 32"]
33366 LOCAL_POSITION_NED(LOCAL_POSITION_NED_DATA),
33367 #[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
33368 #[doc = ""]
33369 #[doc = "ID: 64"]
33370 LOCAL_POSITION_NED_COV(LOCAL_POSITION_NED_COV_DATA),
33371 #[doc = "The offset in X, Y, Z and yaw between the LOCAL_POSITION_NED messages of MAV X and the global coordinate frame in NED coordinates. Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
33372 #[doc = ""]
33373 #[doc = "ID: 89"]
33374 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA),
33375 #[doc = "An ack for a LOGGING_DATA_ACKED message."]
33376 #[doc = ""]
33377 #[doc = "ID: 268"]
33378 LOGGING_ACK(LOGGING_ACK_DATA),
33379 #[doc = "A message containing logged data (see also MAV_CMD_LOGGING_START)."]
33380 #[doc = ""]
33381 #[doc = "ID: 266"]
33382 LOGGING_DATA(LOGGING_DATA_DATA),
33383 #[doc = "A message containing logged data which requires a LOGGING_ACK to be sent back."]
33384 #[doc = ""]
33385 #[doc = "ID: 267"]
33386 LOGGING_DATA_ACKED(LOGGING_DATA_ACKED_DATA),
33387 #[doc = "Reply to LOG_REQUEST_DATA."]
33388 #[doc = ""]
33389 #[doc = "ID: 120"]
33390 LOG_DATA(LOG_DATA_DATA),
33391 #[doc = "Reply to LOG_REQUEST_LIST."]
33392 #[doc = ""]
33393 #[doc = "ID: 118"]
33394 LOG_ENTRY(LOG_ENTRY_DATA),
33395 #[doc = "Erase all logs."]
33396 #[doc = ""]
33397 #[doc = "ID: 121"]
33398 LOG_ERASE(LOG_ERASE_DATA),
33399 #[doc = "Request a chunk of a log."]
33400 #[doc = ""]
33401 #[doc = "ID: 119"]
33402 LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA),
33403 #[doc = "Stop log transfer and resume normal logging."]
33404 #[doc = ""]
33405 #[doc = "ID: 122"]
33406 LOG_REQUEST_END(LOG_REQUEST_END_DATA),
33407 #[doc = "Request a list of available logs. On some systems calling this may stop on-board logging until LOG_REQUEST_END is called. If there are no log files available this request shall be answered with one LOG_ENTRY message with id = 0 and num_logs = 0."]
33408 #[doc = ""]
33409 #[doc = "ID: 117"]
33410 LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA),
33411 #[doc = "Reports results of completed compass calibration. Sent until MAG_CAL_ACK received."]
33412 #[doc = ""]
33413 #[doc = "ID: 192"]
33414 MAG_CAL_REPORT(MAG_CAL_REPORT_DATA),
33415 #[doc = "This message provides an API for manually controlling the vehicle using standard joystick axes nomenclature, along with a joystick-like input device. Unused axes can be disabled and buttons states are transmitted as individual on/off bits of a bitmask."]
33416 #[doc = ""]
33417 #[doc = "ID: 69"]
33418 MANUAL_CONTROL(MANUAL_CONTROL_DATA),
33419 #[doc = "Setpoint in roll, pitch, yaw and thrust from the operator."]
33420 #[doc = ""]
33421 #[doc = "ID: 81"]
33422 MANUAL_SETPOINT(MANUAL_SETPOINT_DATA),
33423 #[doc = "Send raw controller memory. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
33424 #[doc = ""]
33425 #[doc = "ID: 249"]
33426 MEMORY_VECT(MEMORY_VECT_DATA),
33427 #[doc = "The interval between messages for a particular MAVLink message ID. This message is sent in response to the MAV_CMD_REQUEST_MESSAGE command with param1=244 (this message) and param2=message_id (the id of the message for which the interval is required). \tIt may also be sent in response to MAV_CMD_GET_MESSAGE_INTERVAL. \tThis interface replaces DATA_STREAM."]
33428 #[doc = ""]
33429 #[doc = "ID: 244"]
33430 MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA),
33431 #[doc = "Acknowledgment message during waypoint handling. The type field states if this message is a positive ack (type=0) or if an error happened (type=non-zero)."]
33432 #[doc = ""]
33433 #[doc = "ID: 47"]
33434 MISSION_ACK(MISSION_ACK_DATA),
33435 #[doc = "Delete all mission items at once."]
33436 #[doc = ""]
33437 #[doc = "ID: 45"]
33438 MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA),
33439 #[doc = "This message is emitted as response to MISSION_REQUEST_LIST by the MAV and to initiate a write transaction. The GCS can then request the individual mission item based on the knowledge of the total number of waypoints."]
33440 #[doc = ""]
33441 #[doc = "ID: 44"]
33442 MISSION_COUNT(MISSION_COUNT_DATA),
33443 #[doc = "Message that announces the sequence number of the current target mission item (that the system will fly towards/execute when the mission is running). This message should be streamed all the time (nominally at 1Hz). This message should be emitted following a call to MAV_CMD_DO_SET_MISSION_CURRENT or MISSION_SET_CURRENT."]
33444 #[doc = ""]
33445 #[doc = "ID: 42"]
33446 MISSION_CURRENT(MISSION_CURRENT_DATA),
33447 #[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN may be used to indicate an optional/default value (e.g. to use the system's current latitude or yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
33448 #[doc = ""]
33449 #[doc = "ID: 39"]
33450 #[deprecated = " See `MISSION_ITEM_INT` (Deprecated since 2020-06)"]
33451 MISSION_ITEM(MISSION_ITEM_DATA),
33452 #[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
33453 #[doc = ""]
33454 #[doc = "ID: 73"]
33455 MISSION_ITEM_INT(MISSION_ITEM_INT_DATA),
33456 #[doc = "A certain mission item has been reached. The system will either hold this position (or circle on the orbit) or (if the autocontinue on the WP was set) continue to the next waypoint."]
33457 #[doc = ""]
33458 #[doc = "ID: 46"]
33459 MISSION_ITEM_REACHED(MISSION_ITEM_REACHED_DATA),
33460 #[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM message. <https://mavlink.io/en/services/mission.html>."]
33461 #[doc = ""]
33462 #[doc = "ID: 40"]
33463 #[deprecated = "A system that gets this request should respond with MISSION_ITEM_INT (as though MISSION_REQUEST_INT was received). See `MISSION_REQUEST_INT` (Deprecated since 2020-06)"]
33464 MISSION_REQUEST(MISSION_REQUEST_DATA),
33465 #[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM_INT message. <https://mavlink.io/en/services/mission.html>."]
33466 #[doc = ""]
33467 #[doc = "ID: 51"]
33468 MISSION_REQUEST_INT(MISSION_REQUEST_INT_DATA),
33469 #[doc = "Request the overall list of mission items from the system/component."]
33470 #[doc = ""]
33471 #[doc = "ID: 43"]
33472 MISSION_REQUEST_LIST(MISSION_REQUEST_LIST_DATA),
33473 #[doc = "Request a partial list of mission items from the system/component. <https://mavlink.io/en/services/mission.html>. If start and end index are the same, just send one waypoint."]
33474 #[doc = ""]
33475 #[doc = "ID: 37"]
33476 MISSION_REQUEST_PARTIAL_LIST(MISSION_REQUEST_PARTIAL_LIST_DATA),
33477 #[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. Note that mission jump repeat counters are not reset (see MAV_CMD_DO_JUMP param2). This message may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this message must not trigger a switch to mission mode."]
33478 #[doc = ""]
33479 #[doc = "ID: 41"]
33480 #[deprecated = " See `MAV_CMD_DO_SET_MISSION_CURRENT` (Deprecated since 2022-08)"]
33481 MISSION_SET_CURRENT(MISSION_SET_CURRENT_DATA),
33482 #[doc = "This message is sent to the MAV to write a partial list. If start index == end index, only one item will be transmitted / updated. If the start index is NOT 0 and above the current list size, this request should be REJECTED!."]
33483 #[doc = ""]
33484 #[doc = "ID: 38"]
33485 MISSION_WRITE_PARTIAL_LIST(MISSION_WRITE_PARTIAL_LIST_DATA),
33486 #[doc = "Orientation of a mount."]
33487 #[doc = ""]
33488 #[doc = "ID: 265"]
33489 #[deprecated = "This message is being superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
33490 MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA),
33491 #[doc = "Send a key-value pair as float. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
33492 #[doc = ""]
33493 #[doc = "ID: 251"]
33494 NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA),
33495 #[doc = "Send a key-value pair as integer. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
33496 #[doc = ""]
33497 #[doc = "ID: 252"]
33498 NAMED_VALUE_INT(NAMED_VALUE_INT_DATA),
33499 #[doc = "The state of the navigation and position controller."]
33500 #[doc = ""]
33501 #[doc = "ID: 62"]
33502 NAV_CONTROLLER_OUTPUT(NAV_CONTROLLER_OUTPUT_DATA),
33503 #[doc = "Obstacle distances in front of the sensor, starting from the left in increment degrees to the right."]
33504 #[doc = ""]
33505 #[doc = "ID: 330"]
33506 OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA),
33507 #[doc = "Odometry message to communicate odometry information with an external interface. Fits ROS REP 147 standard for aerial vehicles (<http://www.ros.org/reps/rep-0147.html>)."]
33508 #[doc = ""]
33509 #[doc = "ID: 331"]
33510 ODOMETRY(ODOMETRY_DATA),
33511 #[doc = "Hardware status sent by an onboard computer."]
33512 #[doc = ""]
33513 #[doc = "ID: 390"]
33514 ONBOARD_COMPUTER_STATUS(ONBOARD_COMPUTER_STATUS_DATA),
33515 #[doc = "Transmitter (remote ID system) is enabled and ready to start sending location and other required information. This is streamed by transmitter. A flight controller uses it as a condition to arm."]
33516 #[doc = ""]
33517 #[doc = "ID: 12918"]
33518 OPEN_DRONE_ID_ARM_STATUS(OPEN_DRONE_ID_ARM_STATUS_DATA),
33519 #[doc = "Data for filling the OpenDroneID Authentication message. The Authentication Message defines a field that can provide a means of authenticity for the identity of the UAS (Unmanned Aircraft System). The Authentication message can have two different formats. For data page 0, the fields PageCount, Length and TimeStamp are present and AuthData is only 17 bytes. For data page 1 through 15, PageCount, Length and TimeStamp are not present and the size of AuthData is 23 bytes."]
33520 #[doc = ""]
33521 #[doc = "ID: 12902"]
33522 OPEN_DRONE_ID_AUTHENTICATION(OPEN_DRONE_ID_AUTHENTICATION_DATA),
33523 #[doc = "Data for filling the OpenDroneID Basic ID message. This and the below messages are primarily meant for feeding data to/from an OpenDroneID implementation. E.g. <https://github.com/opendroneid/opendroneid-core-c>. These messages are compatible with the ASTM F3411 Remote ID standard and the ASD-STAN prEN 4709-002 Direct Remote ID standard. Additional information and usage of these messages is documented at <https://mavlink.io/en/services/opendroneid.html>."]
33524 #[doc = ""]
33525 #[doc = "ID: 12900"]
33526 OPEN_DRONE_ID_BASIC_ID(OPEN_DRONE_ID_BASIC_ID_DATA),
33527 #[doc = "Data for filling the OpenDroneID Location message. The float data types are 32-bit IEEE 754. The Location message provides the location, altitude, direction and speed of the aircraft."]
33528 #[doc = ""]
33529 #[doc = "ID: 12901"]
33530 OPEN_DRONE_ID_LOCATION(OPEN_DRONE_ID_LOCATION_DATA),
33531 #[doc = "An OpenDroneID message pack is a container for multiple encoded OpenDroneID messages (i.e. not in the format given for the above message descriptions but after encoding into the compressed OpenDroneID byte format). Used e.g. when transmitting on Bluetooth 5.0 Long Range/Extended Advertising or on WiFi Neighbor Aware Networking or on WiFi Beacon."]
33532 #[doc = ""]
33533 #[doc = "ID: 12915"]
33534 OPEN_DRONE_ID_MESSAGE_PACK(OPEN_DRONE_ID_MESSAGE_PACK_DATA),
33535 #[doc = "Data for filling the OpenDroneID Operator ID message, which contains the CAA (Civil Aviation Authority) issued operator ID."]
33536 #[doc = ""]
33537 #[doc = "ID: 12905"]
33538 OPEN_DRONE_ID_OPERATOR_ID(OPEN_DRONE_ID_OPERATOR_ID_DATA),
33539 #[doc = "Data for filling the OpenDroneID Self ID message. The Self ID Message is an opportunity for the operator to (optionally) declare their identity and purpose of the flight. This message can provide additional information that could reduce the threat profile of a UA (Unmanned Aircraft) flying in a particular area or manner. This message can also be used to provide optional additional clarification in an emergency/remote ID system failure situation."]
33540 #[doc = ""]
33541 #[doc = "ID: 12903"]
33542 OPEN_DRONE_ID_SELF_ID(OPEN_DRONE_ID_SELF_ID_DATA),
33543 #[doc = "Data for filling the OpenDroneID System message. The System Message contains general system information including the operator location/altitude and possible aircraft group and/or category/class information."]
33544 #[doc = ""]
33545 #[doc = "ID: 12904"]
33546 OPEN_DRONE_ID_SYSTEM(OPEN_DRONE_ID_SYSTEM_DATA),
33547 #[doc = "Update the data in the OPEN_DRONE_ID_SYSTEM message with new location information. This can be sent to update the location information for the operator when no other information in the SYSTEM message has changed. This message allows for efficient operation on radio links which have limited uplink bandwidth while meeting requirements for update frequency of the operator location."]
33548 #[doc = ""]
33549 #[doc = "ID: 12919"]
33550 OPEN_DRONE_ID_SYSTEM_UPDATE(OPEN_DRONE_ID_SYSTEM_UPDATE_DATA),
33551 #[doc = "Optical flow from a flow sensor (e.g. optical mouse sensor)."]
33552 #[doc = ""]
33553 #[doc = "ID: 100"]
33554 OPTICAL_FLOW(OPTICAL_FLOW_DATA),
33555 #[doc = "Optical flow from an angular rate flow sensor (e.g. PX4FLOW or mouse sensor)."]
33556 #[doc = ""]
33557 #[doc = "ID: 106"]
33558 OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA),
33559 #[doc = "Vehicle status report that is sent out while orbit execution is in progress (see MAV_CMD_DO_ORBIT)."]
33560 #[doc = ""]
33561 #[doc = "ID: 360"]
33562 ORBIT_EXECUTION_STATUS(ORBIT_EXECUTION_STATUS_DATA),
33563 #[doc = "Response from a PARAM_EXT_SET message."]
33564 #[doc = ""]
33565 #[doc = "ID: 324"]
33566 PARAM_EXT_ACK(PARAM_EXT_ACK_DATA),
33567 #[doc = "Request all parameters of this component. All parameters should be emitted in response as PARAM_EXT_VALUE."]
33568 #[doc = ""]
33569 #[doc = "ID: 321"]
33570 PARAM_EXT_REQUEST_LIST(PARAM_EXT_REQUEST_LIST_DATA),
33571 #[doc = "Request to read the value of a parameter with either the param_id string id or param_index. PARAM_EXT_VALUE should be emitted in response."]
33572 #[doc = ""]
33573 #[doc = "ID: 320"]
33574 PARAM_EXT_REQUEST_READ(PARAM_EXT_REQUEST_READ_DATA),
33575 #[doc = "Set a parameter value. In order to deal with message loss (and retransmission of PARAM_EXT_SET), when setting a parameter value and the new value is the same as the current value, you will immediately get a PARAM_ACK_ACCEPTED response. If the current state is PARAM_ACK_IN_PROGRESS, you will accordingly receive a PARAM_ACK_IN_PROGRESS in response."]
33576 #[doc = ""]
33577 #[doc = "ID: 323"]
33578 PARAM_EXT_SET(PARAM_EXT_SET_DATA),
33579 #[doc = "Emit the value of a parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows them to re-request missing parameters after a loss or timeout."]
33580 #[doc = ""]
33581 #[doc = "ID: 322"]
33582 PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA),
33583 #[doc = "Bind a RC channel to a parameter. The parameter should change according to the RC channel value."]
33584 #[doc = ""]
33585 #[doc = "ID: 50"]
33586 PARAM_MAP_RC(PARAM_MAP_RC_DATA),
33587 #[doc = "Request all parameters of this component. After this request, all parameters are emitted. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
33588 #[doc = ""]
33589 #[doc = "ID: 21"]
33590 PARAM_REQUEST_LIST(PARAM_REQUEST_LIST_DATA),
33591 #[doc = "value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also <https://mavlink.io/en/services/parameter.html> for a full documentation of QGroundControl and IMU code."]
33592 #[doc = ""]
33593 #[doc = "ID: 20"]
33594 PARAM_REQUEST_READ(PARAM_REQUEST_READ_DATA),
33595 #[doc = "Set a parameter value (write new value to permanent storage). The receiving component should acknowledge the new parameter value by broadcasting a PARAM_VALUE message (broadcasting ensures that multiple GCS all have an up-to-date list of all parameters). If the sending GCS did not receive a PARAM_VALUE within its timeout time, it should re-send the PARAM_SET message. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
33596 #[doc = ""]
33597 #[doc = "ID: 23"]
33598 PARAM_SET(PARAM_SET_DATA),
33599 #[doc = "Emit the value of a onboard parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows him to re-request missing parameters after a loss or timeout. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
33600 #[doc = ""]
33601 #[doc = "ID: 22"]
33602 PARAM_VALUE(PARAM_VALUE_DATA),
33603 #[doc = "A ping message either requesting or responding to a ping. This allows to measure the system latencies, including serial port, radio modem and UDP connections. The ping microservice is documented at <https://mavlink.io/en/services/ping.html>."]
33604 #[doc = ""]
33605 #[doc = "ID: 4"]
33606 #[deprecated = "To be removed / merged with TIMESYNC. See `TIMESYNC` (Deprecated since 2011-08)"]
33607 PING(PING_DATA),
33608 #[doc = "Control vehicle tone generation (buzzer)."]
33609 #[doc = ""]
33610 #[doc = "ID: 258"]
33611 #[deprecated = "New version explicitly defines format. More interoperable. See `PLAY_TUNE_V2` (Deprecated since 2019-10)"]
33612 PLAY_TUNE(PLAY_TUNE_DATA),
33613 #[doc = "Play vehicle tone/tune (buzzer). Supersedes message PLAY_TUNE."]
33614 #[doc = ""]
33615 #[doc = "ID: 400"]
33616 PLAY_TUNE_V2(PLAY_TUNE_V2_DATA),
33617 #[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_GLOBAL_INT if the vehicle is being controlled this way."]
33618 #[doc = ""]
33619 #[doc = "ID: 87"]
33620 POSITION_TARGET_GLOBAL_INT(POSITION_TARGET_GLOBAL_INT_DATA),
33621 #[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_LOCAL_NED if the vehicle is being controlled this way."]
33622 #[doc = ""]
33623 #[doc = "ID: 85"]
33624 POSITION_TARGET_LOCAL_NED(POSITION_TARGET_LOCAL_NED_DATA),
33625 #[doc = "Power supply status."]
33626 #[doc = ""]
33627 #[doc = "ID: 125"]
33628 POWER_STATUS(POWER_STATUS_DATA),
33629 #[doc = "Version and capability of protocol version. This message can be requested with MAV_CMD_REQUEST_MESSAGE and is used as part of the handshaking to establish which MAVLink version should be used on the network. Every node should respond to a request for PROTOCOL_VERSION to enable the handshaking. Library implementers should consider adding this into the default decoding state machine to allow the protocol core to respond directly."]
33630 #[doc = ""]
33631 #[doc = "ID: 300"]
33632 PROTOCOL_VERSION(PROTOCOL_VERSION_DATA),
33633 #[doc = "Status generated by radio and injected into MAVLink stream."]
33634 #[doc = ""]
33635 #[doc = "ID: 109"]
33636 RADIO_STATUS(RADIO_STATUS_DATA),
33637 #[doc = "The RAW IMU readings for a 9DOF sensor, which is identified by the id (default IMU1). This message should always contain the true raw values without any scaling to allow data capture and system debugging."]
33638 #[doc = ""]
33639 #[doc = "ID: 27"]
33640 RAW_IMU(RAW_IMU_DATA),
33641 #[doc = "The RAW pressure readings for the typical setup of one absolute pressure and one differential pressure sensor. The sensor values should be the raw, UNSCALED ADC values."]
33642 #[doc = ""]
33643 #[doc = "ID: 28"]
33644 RAW_PRESSURE(RAW_PRESSURE_DATA),
33645 #[doc = "RPM sensor data message."]
33646 #[doc = ""]
33647 #[doc = "ID: 339"]
33648 RAW_RPM(RAW_RPM_DATA),
33649 #[doc = "The PPM values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
33650 #[doc = ""]
33651 #[doc = "ID: 65"]
33652 RC_CHANNELS(RC_CHANNELS_DATA),
33653 #[doc = "The RAW values of the RC channels sent to the MAV to override info received from the RC radio. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. Note carefully the semantic differences between the first 8 channels and the subsequent channels."]
33654 #[doc = ""]
33655 #[doc = "ID: 70"]
33656 RC_CHANNELS_OVERRIDE(RC_CHANNELS_OVERRIDE_DATA),
33657 #[doc = "The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
33658 #[doc = ""]
33659 #[doc = "ID: 35"]
33660 RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA),
33661 #[doc = "The scaled values of the RC channels received: (-100%) -10000, (0%) 0, (100%) 10000. Channels that are inactive should be set to INT16_MAX."]
33662 #[doc = ""]
33663 #[doc = "ID: 34"]
33664 RC_CHANNELS_SCALED(RC_CHANNELS_SCALED_DATA),
33665 #[doc = "Request a data stream."]
33666 #[doc = ""]
33667 #[doc = "ID: 66"]
33668 #[deprecated = " See `MAV_CMD_SET_MESSAGE_INTERVAL ` (Deprecated since 2015-08)"]
33669 REQUEST_DATA_STREAM(REQUEST_DATA_STREAM_DATA),
33670 #[doc = "Request one or more events to be (re-)sent. If first_sequence==last_sequence, only a single event is requested. Note that first_sequence can be larger than last_sequence (because the sequence number can wrap). Each sequence will trigger an EVENT or EVENT_ERROR response."]
33671 #[doc = ""]
33672 #[doc = "ID: 412"]
33673 REQUEST_EVENT(REQUEST_EVENT_DATA),
33674 #[doc = "The autopilot is requesting a resource (file, binary, other type of data)."]
33675 #[doc = ""]
33676 #[doc = "ID: 142"]
33677 RESOURCE_REQUEST(RESOURCE_REQUEST_DATA),
33678 #[doc = "Response to a REQUEST_EVENT in case of an error (e.g. the event is not available anymore)."]
33679 #[doc = ""]
33680 #[doc = "ID: 413"]
33681 RESPONSE_EVENT_ERROR(RESPONSE_EVENT_ERROR_DATA),
33682 #[doc = "Read out the safety zone the MAV currently assumes."]
33683 #[doc = ""]
33684 #[doc = "ID: 55"]
33685 SAFETY_ALLOWED_AREA(SAFETY_ALLOWED_AREA_DATA),
33686 #[doc = "Set a safety zone (volume), which is defined by two corners of a cube. This message can be used to tell the MAV which setpoints/waypoints to accept and which to reject. Safety areas are often enforced by national or competition regulations."]
33687 #[doc = ""]
33688 #[doc = "ID: 54"]
33689 SAFETY_SET_ALLOWED_AREA(SAFETY_SET_ALLOWED_AREA_DATA),
33690 #[doc = "The RAW IMU readings for the usual 9DOF sensor setup. This message should contain the scaled values to the described units."]
33691 #[doc = ""]
33692 #[doc = "ID: 26"]
33693 SCALED_IMU(SCALED_IMU_DATA),
33694 #[doc = "The RAW IMU readings for secondary 9DOF sensor setup. This message should contain the scaled values to the described units."]
33695 #[doc = ""]
33696 #[doc = "ID: 116"]
33697 SCALED_IMU2(SCALED_IMU2_DATA),
33698 #[doc = "The RAW IMU readings for 3rd 9DOF sensor setup. This message should contain the scaled values to the described units."]
33699 #[doc = ""]
33700 #[doc = "ID: 129"]
33701 SCALED_IMU3(SCALED_IMU3_DATA),
33702 #[doc = "The pressure readings for the typical setup of one absolute and differential pressure sensor. The units are as specified in each field."]
33703 #[doc = ""]
33704 #[doc = "ID: 29"]
33705 SCALED_PRESSURE(SCALED_PRESSURE_DATA),
33706 #[doc = "Barometer readings for 2nd barometer."]
33707 #[doc = ""]
33708 #[doc = "ID: 137"]
33709 SCALED_PRESSURE2(SCALED_PRESSURE2_DATA),
33710 #[doc = "Barometer readings for 3rd barometer."]
33711 #[doc = ""]
33712 #[doc = "ID: 143"]
33713 SCALED_PRESSURE3(SCALED_PRESSURE3_DATA),
33714 #[doc = "Control a serial port. This can be used for raw access to an onboard serial peripheral such as a GPS or telemetry radio. It is designed to make it possible to update the devices firmware via MAVLink messages or change the devices settings. A message with zero bytes can be used to change just the baudrate."]
33715 #[doc = ""]
33716 #[doc = "ID: 126"]
33717 SERIAL_CONTROL(SERIAL_CONTROL_DATA),
33718 #[doc = "Superseded by ACTUATOR_OUTPUT_STATUS. The RAW values of the servo outputs (for RC input from the remote, use the RC_CHANNELS messages). The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%."]
33719 #[doc = ""]
33720 #[doc = "ID: 36"]
33721 SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA),
33722 #[doc = "Setup a MAVLink2 signing key. If called with secret_key of all zero and zero initial_timestamp will disable signing."]
33723 #[doc = ""]
33724 #[doc = "ID: 256"]
33725 SETUP_SIGNING(SETUP_SIGNING_DATA),
33726 #[doc = "Set the vehicle attitude and body angular rates."]
33727 #[doc = ""]
33728 #[doc = "ID: 139"]
33729 SET_ACTUATOR_CONTROL_TARGET(SET_ACTUATOR_CONTROL_TARGET_DATA),
33730 #[doc = "Sets a desired vehicle attitude. Used by an external controller to command the vehicle (manual controller or other system)."]
33731 #[doc = ""]
33732 #[doc = "ID: 82"]
33733 SET_ATTITUDE_TARGET(SET_ATTITUDE_TARGET_DATA),
33734 #[doc = "Sets the GPS coordinates of the vehicle local origin (0,0,0) position. Vehicle should emit GPS_GLOBAL_ORIGIN irrespective of whether the origin is changed. This enables transform between the local coordinate frame and the global (GPS) coordinate frame, which may be necessary when (for example) indoor and outdoor settings are connected and the MAV should move from in- to outdoor."]
33735 #[doc = ""]
33736 #[doc = "ID: 48"]
33737 #[deprecated = " See `MAV_CMD_SET_GLOBAL_ORIGIN` (Deprecated since 2025-04)"]
33738 SET_GPS_GLOBAL_ORIGIN(SET_GPS_GLOBAL_ORIGIN_DATA),
33739 #[doc = "Sets the home position. \tThe home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this message). The global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. Under normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. The approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
33740 #[doc = ""]
33741 #[doc = "ID: 243"]
33742 #[deprecated = "The command protocol version (MAV_CMD_DO_SET_HOME) allows a GCS to detect when setting the home position has failed. See `MAV_CMD_DO_SET_HOME` (Deprecated since 2022-02)"]
33743 SET_HOME_POSITION(SET_HOME_POSITION_DATA),
33744 #[doc = "Set the system mode, as defined by enum MAV_MODE. There is no target component id as the mode is by definition for the overall aircraft, not only for one component."]
33745 #[doc = ""]
33746 #[doc = "ID: 11"]
33747 #[deprecated = "Use COMMAND_LONG with MAV_CMD_DO_SET_MODE instead. See `MAV_CMD_DO_SET_MODE` (Deprecated since 2015-12)"]
33748 SET_MODE(SET_MODE_DATA),
33749 #[doc = "Sets a desired vehicle position, velocity, and/or acceleration in a global coordinate system (WGS84). Used by an external controller to command the vehicle (manual controller or other system)."]
33750 #[doc = ""]
33751 #[doc = "ID: 86"]
33752 SET_POSITION_TARGET_GLOBAL_INT(SET_POSITION_TARGET_GLOBAL_INT_DATA),
33753 #[doc = "Sets a desired vehicle position in a local north-east-down coordinate frame. Used by an external controller to command the vehicle (manual controller or other system)."]
33754 #[doc = ""]
33755 #[doc = "ID: 84"]
33756 SET_POSITION_TARGET_LOCAL_NED(SET_POSITION_TARGET_LOCAL_NED_DATA),
33757 #[doc = "Status of simulation environment, if used."]
33758 #[doc = ""]
33759 #[doc = "ID: 108"]
33760 SIM_STATE(SIM_STATE_DATA),
33761 #[doc = "Smart Battery information (static/infrequent update). Use for updates from: smart battery to flight stack, flight stack to GCS. Use BATTERY_STATUS for the frequent battery updates."]
33762 #[doc = ""]
33763 #[doc = "ID: 370"]
33764 #[deprecated = "The BATTERY_INFO message is better aligned with UAVCAN messages, and in any case is useful even if a battery is not \"smart\". See `BATTERY_INFO` (Deprecated since 2024-02)"]
33765 SMART_BATTERY_INFO(SMART_BATTERY_INFO_DATA),
33766 #[doc = "Status text message. These messages are printed in yellow in the COMM console of QGroundControl. WARNING: They consume quite some bandwidth, so use only for important status and error messages. If implemented wisely, these messages are buffered on the MCU and sent only at a limited rate (e.g. 10 Hz)."]
33767 #[doc = ""]
33768 #[doc = "ID: 253"]
33769 STATUSTEXT(STATUSTEXT_DATA),
33770 #[doc = "Information about a storage medium. This message is sent in response to a request with MAV_CMD_REQUEST_MESSAGE and whenever the status of the storage changes (STORAGE_STATUS). Use MAV_CMD_REQUEST_MESSAGE.param2 to indicate the index/id of requested storage: 0 for all, 1 for first, 2 for second, etc."]
33771 #[doc = ""]
33772 #[doc = "ID: 261"]
33773 STORAGE_INFORMATION(STORAGE_INFORMATION_DATA),
33774 #[doc = "Tune formats supported by vehicle. This should be emitted as response to MAV_CMD_REQUEST_MESSAGE."]
33775 #[doc = ""]
33776 #[doc = "ID: 401"]
33777 SUPPORTED_TUNES(SUPPORTED_TUNES_DATA),
33778 #[doc = "The system time is the time of the master clock. This can be emitted by flight controllers, onboard computers, or other components in the MAVLink network. Components that are using a less reliable time source, such as a battery-backed real time clock, can choose to match their system clock to that of a SYSTEM_TYPE that indicates a more recent time. This allows more broadly accurate date stamping of logs, and so on. If precise time synchronization is needed then use TIMESYNC instead."]
33779 #[doc = ""]
33780 #[doc = "ID: 2"]
33781 SYSTEM_TIME(SYSTEM_TIME_DATA),
33782 #[doc = "The general system state. If the system is following the MAVLink standard, the system state is mainly defined by three orthogonal states/modes: The system mode, which is either LOCKED (motors shut down and locked), MANUAL (system under RC control), GUIDED (system with autonomous position control, position setpoint controlled manually) or AUTO (system guided by path/waypoint planner). The NAV_MODE defined the current flight state: LIFTOFF (often an open-loop maneuver), LANDING, WAYPOINTS or VECTOR. This represents the internal navigation state machine. The system status shows whether the system is currently active or not and if an emergency occurred. During the CRITICAL and EMERGENCY states the MAV is still considered to be active, but should start emergency procedures autonomously. After a failure occurred it should first move from active to critical to allow manual intervention and then move to emergency after a certain timeout."]
33783 #[doc = ""]
33784 #[doc = "ID: 1"]
33785 SYS_STATUS(SYS_STATUS_DATA),
33786 #[doc = "Request that the vehicle report terrain height at the given location (expected response is a TERRAIN_REPORT). Used by GCS to check if vehicle has all terrain data needed for a mission."]
33787 #[doc = ""]
33788 #[doc = "ID: 135"]
33789 TERRAIN_CHECK(TERRAIN_CHECK_DATA),
33790 #[doc = "Terrain data sent from GCS. The lat/lon and grid_spacing must be the same as a lat/lon from a TERRAIN_REQUEST. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
33791 #[doc = ""]
33792 #[doc = "ID: 134"]
33793 TERRAIN_DATA(TERRAIN_DATA_DATA),
33794 #[doc = "Streamed from drone to report progress of terrain map download (initiated by TERRAIN_REQUEST), or sent as a response to a TERRAIN_CHECK request. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
33795 #[doc = ""]
33796 #[doc = "ID: 136"]
33797 TERRAIN_REPORT(TERRAIN_REPORT_DATA),
33798 #[doc = "Request for terrain data and terrain status. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
33799 #[doc = ""]
33800 #[doc = "ID: 133"]
33801 TERRAIN_REQUEST(TERRAIN_REQUEST_DATA),
33802 #[doc = "Time synchronization message. The message is used for both timesync requests and responses. The request is sent with `ts1=syncing component timestamp` and `tc1=0`, and may be broadcast or targeted to a specific system/component. The response is sent with `ts1=syncing component timestamp` (mirror back unchanged), and `tc1=responding component timestamp`, with the `target_system` and `target_component` set to ids of the original request. Systems can determine if they are receiving a request or response based on the value of `tc`. If the response has `target_system==target_component==0` the remote system has not been updated to use the component IDs and cannot reliably timesync; the requestor may report an error. Timestamps are UNIX Epoch time or time since system boot in nanoseconds (the timestamp format can be inferred by checking for the magnitude of the number; generally it doesn't matter as only the offset is used). The message sequence is repeated numerous times with results being filtered/averaged to estimate the offset. See also: <https://mavlink.io/en/services/timesync.html>."]
33803 #[doc = ""]
33804 #[doc = "ID: 111"]
33805 TIMESYNC(TIMESYNC_DATA),
33806 #[doc = "Time/duration estimates for various events and actions given the current vehicle state and position."]
33807 #[doc = ""]
33808 #[doc = "ID: 380"]
33809 TIME_ESTIMATE_TO_TARGET(TIME_ESTIMATE_TO_TARGET_DATA),
33810 #[doc = "Describe a trajectory using an array of up-to 5 bezier control points in the local frame (MAV_FRAME_LOCAL_NED)."]
33811 #[doc = ""]
33812 #[doc = "ID: 333"]
33813 TRAJECTORY_REPRESENTATION_BEZIER(TRAJECTORY_REPRESENTATION_BEZIER_DATA),
33814 #[doc = "Describe a trajectory using an array of up-to 5 waypoints in the local frame (MAV_FRAME_LOCAL_NED)."]
33815 #[doc = ""]
33816 #[doc = "ID: 332"]
33817 TRAJECTORY_REPRESENTATION_WAYPOINTS(TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA),
33818 #[doc = "Message for transporting \"arbitrary\" variable-length data from one component to another (broadcast is not forbidden, but discouraged). The encoding of the data is usually extension specific, i.e. determined by the source, and is usually not documented as part of the MAVLink specification."]
33819 #[doc = ""]
33820 #[doc = "ID: 385"]
33821 TUNNEL(TUNNEL_DATA),
33822 #[doc = "General information describing a particular UAVCAN node. Please refer to the definition of the UAVCAN service \"uavcan.protocol.GetNodeInfo\" for the background information. This message should be emitted by the system whenever a new node appears online, or an existing node reboots. Additionally, it can be emitted upon request from the other end of the MAVLink channel (see MAV_CMD_UAVCAN_GET_NODE_INFO). It is also not prohibited to emit this message unconditionally at a low frequency. The UAVCAN specification is available at <http://uavcan.org>."]
33823 #[doc = ""]
33824 #[doc = "ID: 311"]
33825 UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA),
33826 #[doc = "General status information of an UAVCAN node. Please refer to the definition of the UAVCAN message \"uavcan.protocol.NodeStatus\" for the background information. The UAVCAN specification is available at <http://uavcan.org>."]
33827 #[doc = ""]
33828 #[doc = "ID: 310"]
33829 UAVCAN_NODE_STATUS(UAVCAN_NODE_STATUS_DATA),
33830 #[doc = "The global position resulting from GPS and sensor fusion."]
33831 #[doc = ""]
33832 #[doc = "ID: 340"]
33833 UTM_GLOBAL_POSITION(UTM_GLOBAL_POSITION_DATA),
33834 #[doc = "Message implementing parts of the V2 payload specs in V1 frames for transitional support."]
33835 #[doc = ""]
33836 #[doc = "ID: 248"]
33837 V2_EXTENSION(V2_EXTENSION_DATA),
33838 #[doc = "Metrics typically displayed on a HUD for fixed wing aircraft."]
33839 #[doc = ""]
33840 #[doc = "ID: 74"]
33841 VFR_HUD(VFR_HUD_DATA),
33842 #[doc = "Vibration levels and accelerometer clipping."]
33843 #[doc = ""]
33844 #[doc = "ID: 241"]
33845 VIBRATION(VIBRATION_DATA),
33846 #[doc = "Global position estimate from a Vicon motion system source."]
33847 #[doc = ""]
33848 #[doc = "ID: 104"]
33849 VICON_POSITION_ESTIMATE(VICON_POSITION_ESTIMATE_DATA),
33850 #[doc = "Information about video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE, where param2 indicates the video stream id: 0 for all streams, 1 for first, 2 for second, etc."]
33851 #[doc = ""]
33852 #[doc = "ID: 269"]
33853 VIDEO_STREAM_INFORMATION(VIDEO_STREAM_INFORMATION_DATA),
33854 #[doc = "Information about the status of a video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE."]
33855 #[doc = ""]
33856 #[doc = "ID: 270"]
33857 VIDEO_STREAM_STATUS(VIDEO_STREAM_STATUS_DATA),
33858 #[doc = "Local position/attitude estimate from a vision source."]
33859 #[doc = ""]
33860 #[doc = "ID: 102"]
33861 VISION_POSITION_ESTIMATE(VISION_POSITION_ESTIMATE_DATA),
33862 #[doc = "Speed estimate from a vision source."]
33863 #[doc = ""]
33864 #[doc = "ID: 103"]
33865 VISION_SPEED_ESTIMATE(VISION_SPEED_ESTIMATE_DATA),
33866 #[doc = "Cumulative distance traveled for each reported wheel."]
33867 #[doc = ""]
33868 #[doc = "ID: 9000"]
33869 WHEEL_DISTANCE(WHEEL_DISTANCE_DATA),
33870 #[doc = "Configure WiFi AP SSID, password, and mode. This message is re-emitted as an acknowledgement by the AP. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
33871 #[doc = ""]
33872 #[doc = "ID: 299"]
33873 WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA),
33874 #[doc = "Winch status."]
33875 #[doc = ""]
33876 #[doc = "ID: 9005"]
33877 WINCH_STATUS(WINCH_STATUS_DATA),
33878 #[doc = "Wind estimate from vehicle. Note that despite the name, this message does not actually contain any covariances but instead variability and accuracy fields in terms of standard deviation (1-STD)."]
33879 #[doc = ""]
33880 #[doc = "ID: 231"]
33881 WIND_COV(WIND_COV_DATA),
33882}
33883impl MavMessage {
33884 pub const fn all_ids() -> &'static [u32] {
33885 &[
33886 0u32, 1u32, 2u32, 4u32, 5u32, 6u32, 7u32, 8u32, 11u32, 20u32, 21u32, 22u32, 23u32,
33887 24u32, 25u32, 26u32, 27u32, 28u32, 29u32, 30u32, 31u32, 32u32, 33u32, 34u32, 35u32,
33888 36u32, 37u32, 38u32, 39u32, 40u32, 41u32, 42u32, 43u32, 44u32, 45u32, 46u32, 47u32,
33889 48u32, 49u32, 50u32, 51u32, 54u32, 55u32, 61u32, 62u32, 63u32, 64u32, 65u32, 66u32,
33890 67u32, 69u32, 70u32, 73u32, 74u32, 75u32, 76u32, 77u32, 80u32, 81u32, 82u32, 83u32,
33891 84u32, 85u32, 86u32, 87u32, 89u32, 90u32, 91u32, 92u32, 93u32, 100u32, 101u32, 102u32,
33892 103u32, 104u32, 105u32, 106u32, 107u32, 108u32, 109u32, 110u32, 111u32, 112u32, 113u32,
33893 114u32, 115u32, 116u32, 117u32, 118u32, 119u32, 120u32, 121u32, 122u32, 123u32, 124u32,
33894 125u32, 126u32, 127u32, 128u32, 129u32, 130u32, 131u32, 132u32, 133u32, 134u32, 135u32,
33895 136u32, 137u32, 138u32, 139u32, 140u32, 141u32, 142u32, 143u32, 144u32, 146u32, 147u32,
33896 148u32, 149u32, 162u32, 192u32, 225u32, 230u32, 231u32, 232u32, 233u32, 234u32, 235u32,
33897 241u32, 242u32, 243u32, 244u32, 245u32, 246u32, 247u32, 248u32, 249u32, 250u32, 251u32,
33898 252u32, 253u32, 254u32, 256u32, 257u32, 258u32, 259u32, 260u32, 261u32, 262u32, 263u32,
33899 264u32, 265u32, 266u32, 267u32, 268u32, 269u32, 270u32, 271u32, 275u32, 276u32, 277u32,
33900 280u32, 281u32, 282u32, 283u32, 284u32, 285u32, 286u32, 287u32, 288u32, 290u32, 291u32,
33901 299u32, 300u32, 301u32, 310u32, 311u32, 320u32, 321u32, 322u32, 323u32, 324u32, 330u32,
33902 331u32, 332u32, 333u32, 334u32, 335u32, 336u32, 339u32, 340u32, 350u32, 360u32, 370u32,
33903 371u32, 372u32, 373u32, 375u32, 380u32, 385u32, 386u32, 387u32, 388u32, 390u32, 395u32,
33904 396u32, 397u32, 400u32, 401u32, 410u32, 411u32, 412u32, 413u32, 435u32, 436u32, 437u32,
33905 440u32, 9000u32, 9005u32, 12900u32, 12901u32, 12902u32, 12903u32, 12904u32, 12905u32,
33906 12915u32, 12918u32, 12919u32, 12920u32, 60050u32, 60051u32, 60052u32, 60053u32,
33907 ]
33908 }
33909}
33910impl Message for MavMessage {
33911 fn parse(
33912 version: MavlinkVersion,
33913 id: u32,
33914 payload: &[u8],
33915 ) -> Result<Self, ::mavlink_core::error::ParserError> {
33916 match id {
33917 ACTUATOR_CONTROL_TARGET_DATA::ID => {
33918 ACTUATOR_CONTROL_TARGET_DATA::deser(version, payload)
33919 .map(Self::ACTUATOR_CONTROL_TARGET)
33920 }
33921 ACTUATOR_OUTPUT_STATUS_DATA::ID => ACTUATOR_OUTPUT_STATUS_DATA::deser(version, payload)
33922 .map(Self::ACTUATOR_OUTPUT_STATUS),
33923 ADSB_VEHICLE_DATA::ID => {
33924 ADSB_VEHICLE_DATA::deser(version, payload).map(Self::ADSB_VEHICLE)
33925 }
33926 AIS_VESSEL_DATA::ID => AIS_VESSEL_DATA::deser(version, payload).map(Self::AIS_VESSEL),
33927 ALTITUDE_DATA::ID => ALTITUDE_DATA::deser(version, payload).map(Self::ALTITUDE),
33928 ATTITUDE_DATA::ID => ATTITUDE_DATA::deser(version, payload).map(Self::ATTITUDE),
33929 ATTITUDE_QUATERNION_DATA::ID => {
33930 ATTITUDE_QUATERNION_DATA::deser(version, payload).map(Self::ATTITUDE_QUATERNION)
33931 }
33932 ATTITUDE_QUATERNION_COV_DATA::ID => {
33933 ATTITUDE_QUATERNION_COV_DATA::deser(version, payload)
33934 .map(Self::ATTITUDE_QUATERNION_COV)
33935 }
33936 ATTITUDE_TARGET_DATA::ID => {
33937 ATTITUDE_TARGET_DATA::deser(version, payload).map(Self::ATTITUDE_TARGET)
33938 }
33939 ATT_POS_MOCAP_DATA::ID => {
33940 ATT_POS_MOCAP_DATA::deser(version, payload).map(Self::ATT_POS_MOCAP)
33941 }
33942 AUTH_KEY_DATA::ID => AUTH_KEY_DATA::deser(version, payload).map(Self::AUTH_KEY),
33943 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
33944 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::deser(version, payload)
33945 .map(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE)
33946 }
33947 AUTOPILOT_VERSION_DATA::ID => {
33948 AUTOPILOT_VERSION_DATA::deser(version, payload).map(Self::AUTOPILOT_VERSION)
33949 }
33950 AVAILABLE_MODES_DATA::ID => {
33951 AVAILABLE_MODES_DATA::deser(version, payload).map(Self::AVAILABLE_MODES)
33952 }
33953 AVAILABLE_MODES_MONITOR_DATA::ID => {
33954 AVAILABLE_MODES_MONITOR_DATA::deser(version, payload)
33955 .map(Self::AVAILABLE_MODES_MONITOR)
33956 }
33957 AVSS_DRONE_IMU_DATA::ID => {
33958 AVSS_DRONE_IMU_DATA::deser(version, payload).map(Self::AVSS_DRONE_IMU)
33959 }
33960 AVSS_DRONE_OPERATION_MODE_DATA::ID => {
33961 AVSS_DRONE_OPERATION_MODE_DATA::deser(version, payload)
33962 .map(Self::AVSS_DRONE_OPERATION_MODE)
33963 }
33964 AVSS_DRONE_POSITION_DATA::ID => {
33965 AVSS_DRONE_POSITION_DATA::deser(version, payload).map(Self::AVSS_DRONE_POSITION)
33966 }
33967 AVSS_PRS_SYS_STATUS_DATA::ID => {
33968 AVSS_PRS_SYS_STATUS_DATA::deser(version, payload).map(Self::AVSS_PRS_SYS_STATUS)
33969 }
33970 BATTERY_INFO_DATA::ID => {
33971 BATTERY_INFO_DATA::deser(version, payload).map(Self::BATTERY_INFO)
33972 }
33973 BATTERY_STATUS_DATA::ID => {
33974 BATTERY_STATUS_DATA::deser(version, payload).map(Self::BATTERY_STATUS)
33975 }
33976 BUTTON_CHANGE_DATA::ID => {
33977 BUTTON_CHANGE_DATA::deser(version, payload).map(Self::BUTTON_CHANGE)
33978 }
33979 CAMERA_CAPTURE_STATUS_DATA::ID => {
33980 CAMERA_CAPTURE_STATUS_DATA::deser(version, payload).map(Self::CAMERA_CAPTURE_STATUS)
33981 }
33982 CAMERA_FOV_STATUS_DATA::ID => {
33983 CAMERA_FOV_STATUS_DATA::deser(version, payload).map(Self::CAMERA_FOV_STATUS)
33984 }
33985 CAMERA_IMAGE_CAPTURED_DATA::ID => {
33986 CAMERA_IMAGE_CAPTURED_DATA::deser(version, payload).map(Self::CAMERA_IMAGE_CAPTURED)
33987 }
33988 CAMERA_INFORMATION_DATA::ID => {
33989 CAMERA_INFORMATION_DATA::deser(version, payload).map(Self::CAMERA_INFORMATION)
33990 }
33991 CAMERA_SETTINGS_DATA::ID => {
33992 CAMERA_SETTINGS_DATA::deser(version, payload).map(Self::CAMERA_SETTINGS)
33993 }
33994 CAMERA_THERMAL_RANGE_DATA::ID => {
33995 CAMERA_THERMAL_RANGE_DATA::deser(version, payload).map(Self::CAMERA_THERMAL_RANGE)
33996 }
33997 CAMERA_TRACKING_GEO_STATUS_DATA::ID => {
33998 CAMERA_TRACKING_GEO_STATUS_DATA::deser(version, payload)
33999 .map(Self::CAMERA_TRACKING_GEO_STATUS)
34000 }
34001 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => {
34002 CAMERA_TRACKING_IMAGE_STATUS_DATA::deser(version, payload)
34003 .map(Self::CAMERA_TRACKING_IMAGE_STATUS)
34004 }
34005 CAMERA_TRIGGER_DATA::ID => {
34006 CAMERA_TRIGGER_DATA::deser(version, payload).map(Self::CAMERA_TRIGGER)
34007 }
34008 CANFD_FRAME_DATA::ID => {
34009 CANFD_FRAME_DATA::deser(version, payload).map(Self::CANFD_FRAME)
34010 }
34011 CAN_FILTER_MODIFY_DATA::ID => {
34012 CAN_FILTER_MODIFY_DATA::deser(version, payload).map(Self::CAN_FILTER_MODIFY)
34013 }
34014 CAN_FRAME_DATA::ID => CAN_FRAME_DATA::deser(version, payload).map(Self::CAN_FRAME),
34015 CELLULAR_CONFIG_DATA::ID => {
34016 CELLULAR_CONFIG_DATA::deser(version, payload).map(Self::CELLULAR_CONFIG)
34017 }
34018 CELLULAR_STATUS_DATA::ID => {
34019 CELLULAR_STATUS_DATA::deser(version, payload).map(Self::CELLULAR_STATUS)
34020 }
34021 CHANGE_OPERATOR_CONTROL_DATA::ID => {
34022 CHANGE_OPERATOR_CONTROL_DATA::deser(version, payload)
34023 .map(Self::CHANGE_OPERATOR_CONTROL)
34024 }
34025 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => {
34026 CHANGE_OPERATOR_CONTROL_ACK_DATA::deser(version, payload)
34027 .map(Self::CHANGE_OPERATOR_CONTROL_ACK)
34028 }
34029 COLLISION_DATA::ID => COLLISION_DATA::deser(version, payload).map(Self::COLLISION),
34030 COMMAND_ACK_DATA::ID => {
34031 COMMAND_ACK_DATA::deser(version, payload).map(Self::COMMAND_ACK)
34032 }
34033 COMMAND_CANCEL_DATA::ID => {
34034 COMMAND_CANCEL_DATA::deser(version, payload).map(Self::COMMAND_CANCEL)
34035 }
34036 COMMAND_INT_DATA::ID => {
34037 COMMAND_INT_DATA::deser(version, payload).map(Self::COMMAND_INT)
34038 }
34039 COMMAND_LONG_DATA::ID => {
34040 COMMAND_LONG_DATA::deser(version, payload).map(Self::COMMAND_LONG)
34041 }
34042 COMPONENT_INFORMATION_DATA::ID => {
34043 COMPONENT_INFORMATION_DATA::deser(version, payload).map(Self::COMPONENT_INFORMATION)
34044 }
34045 COMPONENT_INFORMATION_BASIC_DATA::ID => {
34046 COMPONENT_INFORMATION_BASIC_DATA::deser(version, payload)
34047 .map(Self::COMPONENT_INFORMATION_BASIC)
34048 }
34049 COMPONENT_METADATA_DATA::ID => {
34050 COMPONENT_METADATA_DATA::deser(version, payload).map(Self::COMPONENT_METADATA)
34051 }
34052 CONTROL_SYSTEM_STATE_DATA::ID => {
34053 CONTROL_SYSTEM_STATE_DATA::deser(version, payload).map(Self::CONTROL_SYSTEM_STATE)
34054 }
34055 CURRENT_EVENT_SEQUENCE_DATA::ID => CURRENT_EVENT_SEQUENCE_DATA::deser(version, payload)
34056 .map(Self::CURRENT_EVENT_SEQUENCE),
34057 CURRENT_MODE_DATA::ID => {
34058 CURRENT_MODE_DATA::deser(version, payload).map(Self::CURRENT_MODE)
34059 }
34060 DATA_STREAM_DATA::ID => {
34061 DATA_STREAM_DATA::deser(version, payload).map(Self::DATA_STREAM)
34062 }
34063 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => {
34064 DATA_TRANSMISSION_HANDSHAKE_DATA::deser(version, payload)
34065 .map(Self::DATA_TRANSMISSION_HANDSHAKE)
34066 }
34067 DEBUG_DATA::ID => DEBUG_DATA::deser(version, payload).map(Self::DEBUG),
34068 DEBUG_FLOAT_ARRAY_DATA::ID => {
34069 DEBUG_FLOAT_ARRAY_DATA::deser(version, payload).map(Self::DEBUG_FLOAT_ARRAY)
34070 }
34071 DEBUG_VECT_DATA::ID => DEBUG_VECT_DATA::deser(version, payload).map(Self::DEBUG_VECT),
34072 DISTANCE_SENSOR_DATA::ID => {
34073 DISTANCE_SENSOR_DATA::deser(version, payload).map(Self::DISTANCE_SENSOR)
34074 }
34075 EFI_STATUS_DATA::ID => EFI_STATUS_DATA::deser(version, payload).map(Self::EFI_STATUS),
34076 ENCAPSULATED_DATA_DATA::ID => {
34077 ENCAPSULATED_DATA_DATA::deser(version, payload).map(Self::ENCAPSULATED_DATA)
34078 }
34079 ESC_INFO_DATA::ID => ESC_INFO_DATA::deser(version, payload).map(Self::ESC_INFO),
34080 ESC_STATUS_DATA::ID => ESC_STATUS_DATA::deser(version, payload).map(Self::ESC_STATUS),
34081 ESTIMATOR_STATUS_DATA::ID => {
34082 ESTIMATOR_STATUS_DATA::deser(version, payload).map(Self::ESTIMATOR_STATUS)
34083 }
34084 EVENT_DATA::ID => EVENT_DATA::deser(version, payload).map(Self::EVENT),
34085 EXTENDED_SYS_STATE_DATA::ID => {
34086 EXTENDED_SYS_STATE_DATA::deser(version, payload).map(Self::EXTENDED_SYS_STATE)
34087 }
34088 FENCE_STATUS_DATA::ID => {
34089 FENCE_STATUS_DATA::deser(version, payload).map(Self::FENCE_STATUS)
34090 }
34091 FILE_TRANSFER_PROTOCOL_DATA::ID => FILE_TRANSFER_PROTOCOL_DATA::deser(version, payload)
34092 .map(Self::FILE_TRANSFER_PROTOCOL),
34093 FLIGHT_INFORMATION_DATA::ID => {
34094 FLIGHT_INFORMATION_DATA::deser(version, payload).map(Self::FLIGHT_INFORMATION)
34095 }
34096 FOLLOW_TARGET_DATA::ID => {
34097 FOLLOW_TARGET_DATA::deser(version, payload).map(Self::FOLLOW_TARGET)
34098 }
34099 FUEL_STATUS_DATA::ID => {
34100 FUEL_STATUS_DATA::deser(version, payload).map(Self::FUEL_STATUS)
34101 }
34102 GENERATOR_STATUS_DATA::ID => {
34103 GENERATOR_STATUS_DATA::deser(version, payload).map(Self::GENERATOR_STATUS)
34104 }
34105 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => {
34106 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::deser(version, payload)
34107 .map(Self::GIMBAL_DEVICE_ATTITUDE_STATUS)
34108 }
34109 GIMBAL_DEVICE_INFORMATION_DATA::ID => {
34110 GIMBAL_DEVICE_INFORMATION_DATA::deser(version, payload)
34111 .map(Self::GIMBAL_DEVICE_INFORMATION)
34112 }
34113 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => {
34114 GIMBAL_DEVICE_SET_ATTITUDE_DATA::deser(version, payload)
34115 .map(Self::GIMBAL_DEVICE_SET_ATTITUDE)
34116 }
34117 GIMBAL_MANAGER_INFORMATION_DATA::ID => {
34118 GIMBAL_MANAGER_INFORMATION_DATA::deser(version, payload)
34119 .map(Self::GIMBAL_MANAGER_INFORMATION)
34120 }
34121 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => {
34122 GIMBAL_MANAGER_SET_ATTITUDE_DATA::deser(version, payload)
34123 .map(Self::GIMBAL_MANAGER_SET_ATTITUDE)
34124 }
34125 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
34126 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::deser(version, payload)
34127 .map(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL)
34128 }
34129 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => {
34130 GIMBAL_MANAGER_SET_PITCHYAW_DATA::deser(version, payload)
34131 .map(Self::GIMBAL_MANAGER_SET_PITCHYAW)
34132 }
34133 GIMBAL_MANAGER_STATUS_DATA::ID => {
34134 GIMBAL_MANAGER_STATUS_DATA::deser(version, payload).map(Self::GIMBAL_MANAGER_STATUS)
34135 }
34136 GLOBAL_POSITION_INT_DATA::ID => {
34137 GLOBAL_POSITION_INT_DATA::deser(version, payload).map(Self::GLOBAL_POSITION_INT)
34138 }
34139 GLOBAL_POSITION_INT_COV_DATA::ID => {
34140 GLOBAL_POSITION_INT_COV_DATA::deser(version, payload)
34141 .map(Self::GLOBAL_POSITION_INT_COV)
34142 }
34143 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
34144 GLOBAL_VISION_POSITION_ESTIMATE_DATA::deser(version, payload)
34145 .map(Self::GLOBAL_VISION_POSITION_ESTIMATE)
34146 }
34147 GPS2_RAW_DATA::ID => GPS2_RAW_DATA::deser(version, payload).map(Self::GPS2_RAW),
34148 GPS2_RTK_DATA::ID => GPS2_RTK_DATA::deser(version, payload).map(Self::GPS2_RTK),
34149 GPS_GLOBAL_ORIGIN_DATA::ID => {
34150 GPS_GLOBAL_ORIGIN_DATA::deser(version, payload).map(Self::GPS_GLOBAL_ORIGIN)
34151 }
34152 GPS_INJECT_DATA_DATA::ID => {
34153 GPS_INJECT_DATA_DATA::deser(version, payload).map(Self::GPS_INJECT_DATA)
34154 }
34155 GPS_INPUT_DATA::ID => GPS_INPUT_DATA::deser(version, payload).map(Self::GPS_INPUT),
34156 GPS_RAW_INT_DATA::ID => {
34157 GPS_RAW_INT_DATA::deser(version, payload).map(Self::GPS_RAW_INT)
34158 }
34159 GPS_RTCM_DATA_DATA::ID => {
34160 GPS_RTCM_DATA_DATA::deser(version, payload).map(Self::GPS_RTCM_DATA)
34161 }
34162 GPS_RTK_DATA::ID => GPS_RTK_DATA::deser(version, payload).map(Self::GPS_RTK),
34163 GPS_STATUS_DATA::ID => GPS_STATUS_DATA::deser(version, payload).map(Self::GPS_STATUS),
34164 HEARTBEAT_DATA::ID => HEARTBEAT_DATA::deser(version, payload).map(Self::HEARTBEAT),
34165 HIGHRES_IMU_DATA::ID => {
34166 HIGHRES_IMU_DATA::deser(version, payload).map(Self::HIGHRES_IMU)
34167 }
34168 HIGH_LATENCY_DATA::ID => {
34169 HIGH_LATENCY_DATA::deser(version, payload).map(Self::HIGH_LATENCY)
34170 }
34171 HIGH_LATENCY2_DATA::ID => {
34172 HIGH_LATENCY2_DATA::deser(version, payload).map(Self::HIGH_LATENCY2)
34173 }
34174 HIL_ACTUATOR_CONTROLS_DATA::ID => {
34175 HIL_ACTUATOR_CONTROLS_DATA::deser(version, payload).map(Self::HIL_ACTUATOR_CONTROLS)
34176 }
34177 HIL_CONTROLS_DATA::ID => {
34178 HIL_CONTROLS_DATA::deser(version, payload).map(Self::HIL_CONTROLS)
34179 }
34180 HIL_GPS_DATA::ID => HIL_GPS_DATA::deser(version, payload).map(Self::HIL_GPS),
34181 HIL_OPTICAL_FLOW_DATA::ID => {
34182 HIL_OPTICAL_FLOW_DATA::deser(version, payload).map(Self::HIL_OPTICAL_FLOW)
34183 }
34184 HIL_RC_INPUTS_RAW_DATA::ID => {
34185 HIL_RC_INPUTS_RAW_DATA::deser(version, payload).map(Self::HIL_RC_INPUTS_RAW)
34186 }
34187 HIL_SENSOR_DATA::ID => HIL_SENSOR_DATA::deser(version, payload).map(Self::HIL_SENSOR),
34188 HIL_STATE_DATA::ID => HIL_STATE_DATA::deser(version, payload).map(Self::HIL_STATE),
34189 HIL_STATE_QUATERNION_DATA::ID => {
34190 HIL_STATE_QUATERNION_DATA::deser(version, payload).map(Self::HIL_STATE_QUATERNION)
34191 }
34192 HOME_POSITION_DATA::ID => {
34193 HOME_POSITION_DATA::deser(version, payload).map(Self::HOME_POSITION)
34194 }
34195 HYGROMETER_SENSOR_DATA::ID => {
34196 HYGROMETER_SENSOR_DATA::deser(version, payload).map(Self::HYGROMETER_SENSOR)
34197 }
34198 ILLUMINATOR_STATUS_DATA::ID => {
34199 ILLUMINATOR_STATUS_DATA::deser(version, payload).map(Self::ILLUMINATOR_STATUS)
34200 }
34201 ISBD_LINK_STATUS_DATA::ID => {
34202 ISBD_LINK_STATUS_DATA::deser(version, payload).map(Self::ISBD_LINK_STATUS)
34203 }
34204 LANDING_TARGET_DATA::ID => {
34205 LANDING_TARGET_DATA::deser(version, payload).map(Self::LANDING_TARGET)
34206 }
34207 LINK_NODE_STATUS_DATA::ID => {
34208 LINK_NODE_STATUS_DATA::deser(version, payload).map(Self::LINK_NODE_STATUS)
34209 }
34210 LOCAL_POSITION_NED_DATA::ID => {
34211 LOCAL_POSITION_NED_DATA::deser(version, payload).map(Self::LOCAL_POSITION_NED)
34212 }
34213 LOCAL_POSITION_NED_COV_DATA::ID => LOCAL_POSITION_NED_COV_DATA::deser(version, payload)
34214 .map(Self::LOCAL_POSITION_NED_COV),
34215 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
34216 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::deser(version, payload)
34217 .map(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET)
34218 }
34219 LOGGING_ACK_DATA::ID => {
34220 LOGGING_ACK_DATA::deser(version, payload).map(Self::LOGGING_ACK)
34221 }
34222 LOGGING_DATA_DATA::ID => {
34223 LOGGING_DATA_DATA::deser(version, payload).map(Self::LOGGING_DATA)
34224 }
34225 LOGGING_DATA_ACKED_DATA::ID => {
34226 LOGGING_DATA_ACKED_DATA::deser(version, payload).map(Self::LOGGING_DATA_ACKED)
34227 }
34228 LOG_DATA_DATA::ID => LOG_DATA_DATA::deser(version, payload).map(Self::LOG_DATA),
34229 LOG_ENTRY_DATA::ID => LOG_ENTRY_DATA::deser(version, payload).map(Self::LOG_ENTRY),
34230 LOG_ERASE_DATA::ID => LOG_ERASE_DATA::deser(version, payload).map(Self::LOG_ERASE),
34231 LOG_REQUEST_DATA_DATA::ID => {
34232 LOG_REQUEST_DATA_DATA::deser(version, payload).map(Self::LOG_REQUEST_DATA)
34233 }
34234 LOG_REQUEST_END_DATA::ID => {
34235 LOG_REQUEST_END_DATA::deser(version, payload).map(Self::LOG_REQUEST_END)
34236 }
34237 LOG_REQUEST_LIST_DATA::ID => {
34238 LOG_REQUEST_LIST_DATA::deser(version, payload).map(Self::LOG_REQUEST_LIST)
34239 }
34240 MAG_CAL_REPORT_DATA::ID => {
34241 MAG_CAL_REPORT_DATA::deser(version, payload).map(Self::MAG_CAL_REPORT)
34242 }
34243 MANUAL_CONTROL_DATA::ID => {
34244 MANUAL_CONTROL_DATA::deser(version, payload).map(Self::MANUAL_CONTROL)
34245 }
34246 MANUAL_SETPOINT_DATA::ID => {
34247 MANUAL_SETPOINT_DATA::deser(version, payload).map(Self::MANUAL_SETPOINT)
34248 }
34249 MEMORY_VECT_DATA::ID => {
34250 MEMORY_VECT_DATA::deser(version, payload).map(Self::MEMORY_VECT)
34251 }
34252 MESSAGE_INTERVAL_DATA::ID => {
34253 MESSAGE_INTERVAL_DATA::deser(version, payload).map(Self::MESSAGE_INTERVAL)
34254 }
34255 MISSION_ACK_DATA::ID => {
34256 MISSION_ACK_DATA::deser(version, payload).map(Self::MISSION_ACK)
34257 }
34258 MISSION_CLEAR_ALL_DATA::ID => {
34259 MISSION_CLEAR_ALL_DATA::deser(version, payload).map(Self::MISSION_CLEAR_ALL)
34260 }
34261 MISSION_COUNT_DATA::ID => {
34262 MISSION_COUNT_DATA::deser(version, payload).map(Self::MISSION_COUNT)
34263 }
34264 MISSION_CURRENT_DATA::ID => {
34265 MISSION_CURRENT_DATA::deser(version, payload).map(Self::MISSION_CURRENT)
34266 }
34267 MISSION_ITEM_DATA::ID => {
34268 MISSION_ITEM_DATA::deser(version, payload).map(Self::MISSION_ITEM)
34269 }
34270 MISSION_ITEM_INT_DATA::ID => {
34271 MISSION_ITEM_INT_DATA::deser(version, payload).map(Self::MISSION_ITEM_INT)
34272 }
34273 MISSION_ITEM_REACHED_DATA::ID => {
34274 MISSION_ITEM_REACHED_DATA::deser(version, payload).map(Self::MISSION_ITEM_REACHED)
34275 }
34276 MISSION_REQUEST_DATA::ID => {
34277 MISSION_REQUEST_DATA::deser(version, payload).map(Self::MISSION_REQUEST)
34278 }
34279 MISSION_REQUEST_INT_DATA::ID => {
34280 MISSION_REQUEST_INT_DATA::deser(version, payload).map(Self::MISSION_REQUEST_INT)
34281 }
34282 MISSION_REQUEST_LIST_DATA::ID => {
34283 MISSION_REQUEST_LIST_DATA::deser(version, payload).map(Self::MISSION_REQUEST_LIST)
34284 }
34285 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => {
34286 MISSION_REQUEST_PARTIAL_LIST_DATA::deser(version, payload)
34287 .map(Self::MISSION_REQUEST_PARTIAL_LIST)
34288 }
34289 MISSION_SET_CURRENT_DATA::ID => {
34290 MISSION_SET_CURRENT_DATA::deser(version, payload).map(Self::MISSION_SET_CURRENT)
34291 }
34292 MISSION_WRITE_PARTIAL_LIST_DATA::ID => {
34293 MISSION_WRITE_PARTIAL_LIST_DATA::deser(version, payload)
34294 .map(Self::MISSION_WRITE_PARTIAL_LIST)
34295 }
34296 MOUNT_ORIENTATION_DATA::ID => {
34297 MOUNT_ORIENTATION_DATA::deser(version, payload).map(Self::MOUNT_ORIENTATION)
34298 }
34299 NAMED_VALUE_FLOAT_DATA::ID => {
34300 NAMED_VALUE_FLOAT_DATA::deser(version, payload).map(Self::NAMED_VALUE_FLOAT)
34301 }
34302 NAMED_VALUE_INT_DATA::ID => {
34303 NAMED_VALUE_INT_DATA::deser(version, payload).map(Self::NAMED_VALUE_INT)
34304 }
34305 NAV_CONTROLLER_OUTPUT_DATA::ID => {
34306 NAV_CONTROLLER_OUTPUT_DATA::deser(version, payload).map(Self::NAV_CONTROLLER_OUTPUT)
34307 }
34308 OBSTACLE_DISTANCE_DATA::ID => {
34309 OBSTACLE_DISTANCE_DATA::deser(version, payload).map(Self::OBSTACLE_DISTANCE)
34310 }
34311 ODOMETRY_DATA::ID => ODOMETRY_DATA::deser(version, payload).map(Self::ODOMETRY),
34312 ONBOARD_COMPUTER_STATUS_DATA::ID => {
34313 ONBOARD_COMPUTER_STATUS_DATA::deser(version, payload)
34314 .map(Self::ONBOARD_COMPUTER_STATUS)
34315 }
34316 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => {
34317 OPEN_DRONE_ID_ARM_STATUS_DATA::deser(version, payload)
34318 .map(Self::OPEN_DRONE_ID_ARM_STATUS)
34319 }
34320 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => {
34321 OPEN_DRONE_ID_AUTHENTICATION_DATA::deser(version, payload)
34322 .map(Self::OPEN_DRONE_ID_AUTHENTICATION)
34323 }
34324 OPEN_DRONE_ID_BASIC_ID_DATA::ID => OPEN_DRONE_ID_BASIC_ID_DATA::deser(version, payload)
34325 .map(Self::OPEN_DRONE_ID_BASIC_ID),
34326 OPEN_DRONE_ID_LOCATION_DATA::ID => OPEN_DRONE_ID_LOCATION_DATA::deser(version, payload)
34327 .map(Self::OPEN_DRONE_ID_LOCATION),
34328 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => {
34329 OPEN_DRONE_ID_MESSAGE_PACK_DATA::deser(version, payload)
34330 .map(Self::OPEN_DRONE_ID_MESSAGE_PACK)
34331 }
34332 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => {
34333 OPEN_DRONE_ID_OPERATOR_ID_DATA::deser(version, payload)
34334 .map(Self::OPEN_DRONE_ID_OPERATOR_ID)
34335 }
34336 OPEN_DRONE_ID_SELF_ID_DATA::ID => {
34337 OPEN_DRONE_ID_SELF_ID_DATA::deser(version, payload).map(Self::OPEN_DRONE_ID_SELF_ID)
34338 }
34339 OPEN_DRONE_ID_SYSTEM_DATA::ID => {
34340 OPEN_DRONE_ID_SYSTEM_DATA::deser(version, payload).map(Self::OPEN_DRONE_ID_SYSTEM)
34341 }
34342 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => {
34343 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::deser(version, payload)
34344 .map(Self::OPEN_DRONE_ID_SYSTEM_UPDATE)
34345 }
34346 OPTICAL_FLOW_DATA::ID => {
34347 OPTICAL_FLOW_DATA::deser(version, payload).map(Self::OPTICAL_FLOW)
34348 }
34349 OPTICAL_FLOW_RAD_DATA::ID => {
34350 OPTICAL_FLOW_RAD_DATA::deser(version, payload).map(Self::OPTICAL_FLOW_RAD)
34351 }
34352 ORBIT_EXECUTION_STATUS_DATA::ID => ORBIT_EXECUTION_STATUS_DATA::deser(version, payload)
34353 .map(Self::ORBIT_EXECUTION_STATUS),
34354 PARAM_EXT_ACK_DATA::ID => {
34355 PARAM_EXT_ACK_DATA::deser(version, payload).map(Self::PARAM_EXT_ACK)
34356 }
34357 PARAM_EXT_REQUEST_LIST_DATA::ID => PARAM_EXT_REQUEST_LIST_DATA::deser(version, payload)
34358 .map(Self::PARAM_EXT_REQUEST_LIST),
34359 PARAM_EXT_REQUEST_READ_DATA::ID => PARAM_EXT_REQUEST_READ_DATA::deser(version, payload)
34360 .map(Self::PARAM_EXT_REQUEST_READ),
34361 PARAM_EXT_SET_DATA::ID => {
34362 PARAM_EXT_SET_DATA::deser(version, payload).map(Self::PARAM_EXT_SET)
34363 }
34364 PARAM_EXT_VALUE_DATA::ID => {
34365 PARAM_EXT_VALUE_DATA::deser(version, payload).map(Self::PARAM_EXT_VALUE)
34366 }
34367 PARAM_MAP_RC_DATA::ID => {
34368 PARAM_MAP_RC_DATA::deser(version, payload).map(Self::PARAM_MAP_RC)
34369 }
34370 PARAM_REQUEST_LIST_DATA::ID => {
34371 PARAM_REQUEST_LIST_DATA::deser(version, payload).map(Self::PARAM_REQUEST_LIST)
34372 }
34373 PARAM_REQUEST_READ_DATA::ID => {
34374 PARAM_REQUEST_READ_DATA::deser(version, payload).map(Self::PARAM_REQUEST_READ)
34375 }
34376 PARAM_SET_DATA::ID => PARAM_SET_DATA::deser(version, payload).map(Self::PARAM_SET),
34377 PARAM_VALUE_DATA::ID => {
34378 PARAM_VALUE_DATA::deser(version, payload).map(Self::PARAM_VALUE)
34379 }
34380 PING_DATA::ID => PING_DATA::deser(version, payload).map(Self::PING),
34381 PLAY_TUNE_DATA::ID => PLAY_TUNE_DATA::deser(version, payload).map(Self::PLAY_TUNE),
34382 PLAY_TUNE_V2_DATA::ID => {
34383 PLAY_TUNE_V2_DATA::deser(version, payload).map(Self::PLAY_TUNE_V2)
34384 }
34385 POSITION_TARGET_GLOBAL_INT_DATA::ID => {
34386 POSITION_TARGET_GLOBAL_INT_DATA::deser(version, payload)
34387 .map(Self::POSITION_TARGET_GLOBAL_INT)
34388 }
34389 POSITION_TARGET_LOCAL_NED_DATA::ID => {
34390 POSITION_TARGET_LOCAL_NED_DATA::deser(version, payload)
34391 .map(Self::POSITION_TARGET_LOCAL_NED)
34392 }
34393 POWER_STATUS_DATA::ID => {
34394 POWER_STATUS_DATA::deser(version, payload).map(Self::POWER_STATUS)
34395 }
34396 PROTOCOL_VERSION_DATA::ID => {
34397 PROTOCOL_VERSION_DATA::deser(version, payload).map(Self::PROTOCOL_VERSION)
34398 }
34399 RADIO_STATUS_DATA::ID => {
34400 RADIO_STATUS_DATA::deser(version, payload).map(Self::RADIO_STATUS)
34401 }
34402 RAW_IMU_DATA::ID => RAW_IMU_DATA::deser(version, payload).map(Self::RAW_IMU),
34403 RAW_PRESSURE_DATA::ID => {
34404 RAW_PRESSURE_DATA::deser(version, payload).map(Self::RAW_PRESSURE)
34405 }
34406 RAW_RPM_DATA::ID => RAW_RPM_DATA::deser(version, payload).map(Self::RAW_RPM),
34407 RC_CHANNELS_DATA::ID => {
34408 RC_CHANNELS_DATA::deser(version, payload).map(Self::RC_CHANNELS)
34409 }
34410 RC_CHANNELS_OVERRIDE_DATA::ID => {
34411 RC_CHANNELS_OVERRIDE_DATA::deser(version, payload).map(Self::RC_CHANNELS_OVERRIDE)
34412 }
34413 RC_CHANNELS_RAW_DATA::ID => {
34414 RC_CHANNELS_RAW_DATA::deser(version, payload).map(Self::RC_CHANNELS_RAW)
34415 }
34416 RC_CHANNELS_SCALED_DATA::ID => {
34417 RC_CHANNELS_SCALED_DATA::deser(version, payload).map(Self::RC_CHANNELS_SCALED)
34418 }
34419 REQUEST_DATA_STREAM_DATA::ID => {
34420 REQUEST_DATA_STREAM_DATA::deser(version, payload).map(Self::REQUEST_DATA_STREAM)
34421 }
34422 REQUEST_EVENT_DATA::ID => {
34423 REQUEST_EVENT_DATA::deser(version, payload).map(Self::REQUEST_EVENT)
34424 }
34425 RESOURCE_REQUEST_DATA::ID => {
34426 RESOURCE_REQUEST_DATA::deser(version, payload).map(Self::RESOURCE_REQUEST)
34427 }
34428 RESPONSE_EVENT_ERROR_DATA::ID => {
34429 RESPONSE_EVENT_ERROR_DATA::deser(version, payload).map(Self::RESPONSE_EVENT_ERROR)
34430 }
34431 SAFETY_ALLOWED_AREA_DATA::ID => {
34432 SAFETY_ALLOWED_AREA_DATA::deser(version, payload).map(Self::SAFETY_ALLOWED_AREA)
34433 }
34434 SAFETY_SET_ALLOWED_AREA_DATA::ID => {
34435 SAFETY_SET_ALLOWED_AREA_DATA::deser(version, payload)
34436 .map(Self::SAFETY_SET_ALLOWED_AREA)
34437 }
34438 SCALED_IMU_DATA::ID => SCALED_IMU_DATA::deser(version, payload).map(Self::SCALED_IMU),
34439 SCALED_IMU2_DATA::ID => {
34440 SCALED_IMU2_DATA::deser(version, payload).map(Self::SCALED_IMU2)
34441 }
34442 SCALED_IMU3_DATA::ID => {
34443 SCALED_IMU3_DATA::deser(version, payload).map(Self::SCALED_IMU3)
34444 }
34445 SCALED_PRESSURE_DATA::ID => {
34446 SCALED_PRESSURE_DATA::deser(version, payload).map(Self::SCALED_PRESSURE)
34447 }
34448 SCALED_PRESSURE2_DATA::ID => {
34449 SCALED_PRESSURE2_DATA::deser(version, payload).map(Self::SCALED_PRESSURE2)
34450 }
34451 SCALED_PRESSURE3_DATA::ID => {
34452 SCALED_PRESSURE3_DATA::deser(version, payload).map(Self::SCALED_PRESSURE3)
34453 }
34454 SERIAL_CONTROL_DATA::ID => {
34455 SERIAL_CONTROL_DATA::deser(version, payload).map(Self::SERIAL_CONTROL)
34456 }
34457 SERVO_OUTPUT_RAW_DATA::ID => {
34458 SERVO_OUTPUT_RAW_DATA::deser(version, payload).map(Self::SERVO_OUTPUT_RAW)
34459 }
34460 SETUP_SIGNING_DATA::ID => {
34461 SETUP_SIGNING_DATA::deser(version, payload).map(Self::SETUP_SIGNING)
34462 }
34463 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => {
34464 SET_ACTUATOR_CONTROL_TARGET_DATA::deser(version, payload)
34465 .map(Self::SET_ACTUATOR_CONTROL_TARGET)
34466 }
34467 SET_ATTITUDE_TARGET_DATA::ID => {
34468 SET_ATTITUDE_TARGET_DATA::deser(version, payload).map(Self::SET_ATTITUDE_TARGET)
34469 }
34470 SET_GPS_GLOBAL_ORIGIN_DATA::ID => {
34471 SET_GPS_GLOBAL_ORIGIN_DATA::deser(version, payload).map(Self::SET_GPS_GLOBAL_ORIGIN)
34472 }
34473 SET_HOME_POSITION_DATA::ID => {
34474 SET_HOME_POSITION_DATA::deser(version, payload).map(Self::SET_HOME_POSITION)
34475 }
34476 SET_MODE_DATA::ID => SET_MODE_DATA::deser(version, payload).map(Self::SET_MODE),
34477 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => {
34478 SET_POSITION_TARGET_GLOBAL_INT_DATA::deser(version, payload)
34479 .map(Self::SET_POSITION_TARGET_GLOBAL_INT)
34480 }
34481 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => {
34482 SET_POSITION_TARGET_LOCAL_NED_DATA::deser(version, payload)
34483 .map(Self::SET_POSITION_TARGET_LOCAL_NED)
34484 }
34485 SIM_STATE_DATA::ID => SIM_STATE_DATA::deser(version, payload).map(Self::SIM_STATE),
34486 SMART_BATTERY_INFO_DATA::ID => {
34487 SMART_BATTERY_INFO_DATA::deser(version, payload).map(Self::SMART_BATTERY_INFO)
34488 }
34489 STATUSTEXT_DATA::ID => STATUSTEXT_DATA::deser(version, payload).map(Self::STATUSTEXT),
34490 STORAGE_INFORMATION_DATA::ID => {
34491 STORAGE_INFORMATION_DATA::deser(version, payload).map(Self::STORAGE_INFORMATION)
34492 }
34493 SUPPORTED_TUNES_DATA::ID => {
34494 SUPPORTED_TUNES_DATA::deser(version, payload).map(Self::SUPPORTED_TUNES)
34495 }
34496 SYSTEM_TIME_DATA::ID => {
34497 SYSTEM_TIME_DATA::deser(version, payload).map(Self::SYSTEM_TIME)
34498 }
34499 SYS_STATUS_DATA::ID => SYS_STATUS_DATA::deser(version, payload).map(Self::SYS_STATUS),
34500 TERRAIN_CHECK_DATA::ID => {
34501 TERRAIN_CHECK_DATA::deser(version, payload).map(Self::TERRAIN_CHECK)
34502 }
34503 TERRAIN_DATA_DATA::ID => {
34504 TERRAIN_DATA_DATA::deser(version, payload).map(Self::TERRAIN_DATA)
34505 }
34506 TERRAIN_REPORT_DATA::ID => {
34507 TERRAIN_REPORT_DATA::deser(version, payload).map(Self::TERRAIN_REPORT)
34508 }
34509 TERRAIN_REQUEST_DATA::ID => {
34510 TERRAIN_REQUEST_DATA::deser(version, payload).map(Self::TERRAIN_REQUEST)
34511 }
34512 TIMESYNC_DATA::ID => TIMESYNC_DATA::deser(version, payload).map(Self::TIMESYNC),
34513 TIME_ESTIMATE_TO_TARGET_DATA::ID => {
34514 TIME_ESTIMATE_TO_TARGET_DATA::deser(version, payload)
34515 .map(Self::TIME_ESTIMATE_TO_TARGET)
34516 }
34517 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
34518 TRAJECTORY_REPRESENTATION_BEZIER_DATA::deser(version, payload)
34519 .map(Self::TRAJECTORY_REPRESENTATION_BEZIER)
34520 }
34521 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
34522 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::deser(version, payload)
34523 .map(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS)
34524 }
34525 TUNNEL_DATA::ID => TUNNEL_DATA::deser(version, payload).map(Self::TUNNEL),
34526 UAVCAN_NODE_INFO_DATA::ID => {
34527 UAVCAN_NODE_INFO_DATA::deser(version, payload).map(Self::UAVCAN_NODE_INFO)
34528 }
34529 UAVCAN_NODE_STATUS_DATA::ID => {
34530 UAVCAN_NODE_STATUS_DATA::deser(version, payload).map(Self::UAVCAN_NODE_STATUS)
34531 }
34532 UTM_GLOBAL_POSITION_DATA::ID => {
34533 UTM_GLOBAL_POSITION_DATA::deser(version, payload).map(Self::UTM_GLOBAL_POSITION)
34534 }
34535 V2_EXTENSION_DATA::ID => {
34536 V2_EXTENSION_DATA::deser(version, payload).map(Self::V2_EXTENSION)
34537 }
34538 VFR_HUD_DATA::ID => VFR_HUD_DATA::deser(version, payload).map(Self::VFR_HUD),
34539 VIBRATION_DATA::ID => VIBRATION_DATA::deser(version, payload).map(Self::VIBRATION),
34540 VICON_POSITION_ESTIMATE_DATA::ID => {
34541 VICON_POSITION_ESTIMATE_DATA::deser(version, payload)
34542 .map(Self::VICON_POSITION_ESTIMATE)
34543 }
34544 VIDEO_STREAM_INFORMATION_DATA::ID => {
34545 VIDEO_STREAM_INFORMATION_DATA::deser(version, payload)
34546 .map(Self::VIDEO_STREAM_INFORMATION)
34547 }
34548 VIDEO_STREAM_STATUS_DATA::ID => {
34549 VIDEO_STREAM_STATUS_DATA::deser(version, payload).map(Self::VIDEO_STREAM_STATUS)
34550 }
34551 VISION_POSITION_ESTIMATE_DATA::ID => {
34552 VISION_POSITION_ESTIMATE_DATA::deser(version, payload)
34553 .map(Self::VISION_POSITION_ESTIMATE)
34554 }
34555 VISION_SPEED_ESTIMATE_DATA::ID => {
34556 VISION_SPEED_ESTIMATE_DATA::deser(version, payload).map(Self::VISION_SPEED_ESTIMATE)
34557 }
34558 WHEEL_DISTANCE_DATA::ID => {
34559 WHEEL_DISTANCE_DATA::deser(version, payload).map(Self::WHEEL_DISTANCE)
34560 }
34561 WIFI_CONFIG_AP_DATA::ID => {
34562 WIFI_CONFIG_AP_DATA::deser(version, payload).map(Self::WIFI_CONFIG_AP)
34563 }
34564 WINCH_STATUS_DATA::ID => {
34565 WINCH_STATUS_DATA::deser(version, payload).map(Self::WINCH_STATUS)
34566 }
34567 WIND_COV_DATA::ID => WIND_COV_DATA::deser(version, payload).map(Self::WIND_COV),
34568 _ => Err(::mavlink_core::error::ParserError::UnknownMessage { id }),
34569 }
34570 }
34571 fn message_name(&self) -> &'static str {
34572 match self {
34573 Self::ACTUATOR_CONTROL_TARGET(..) => ACTUATOR_CONTROL_TARGET_DATA::NAME,
34574 Self::ACTUATOR_OUTPUT_STATUS(..) => ACTUATOR_OUTPUT_STATUS_DATA::NAME,
34575 Self::ADSB_VEHICLE(..) => ADSB_VEHICLE_DATA::NAME,
34576 Self::AIS_VESSEL(..) => AIS_VESSEL_DATA::NAME,
34577 Self::ALTITUDE(..) => ALTITUDE_DATA::NAME,
34578 Self::ATTITUDE(..) => ATTITUDE_DATA::NAME,
34579 Self::ATTITUDE_QUATERNION(..) => ATTITUDE_QUATERNION_DATA::NAME,
34580 Self::ATTITUDE_QUATERNION_COV(..) => ATTITUDE_QUATERNION_COV_DATA::NAME,
34581 Self::ATTITUDE_TARGET(..) => ATTITUDE_TARGET_DATA::NAME,
34582 Self::ATT_POS_MOCAP(..) => ATT_POS_MOCAP_DATA::NAME,
34583 Self::AUTH_KEY(..) => AUTH_KEY_DATA::NAME,
34584 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(..) => {
34585 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME
34586 }
34587 Self::AUTOPILOT_VERSION(..) => AUTOPILOT_VERSION_DATA::NAME,
34588 Self::AVAILABLE_MODES(..) => AVAILABLE_MODES_DATA::NAME,
34589 Self::AVAILABLE_MODES_MONITOR(..) => AVAILABLE_MODES_MONITOR_DATA::NAME,
34590 Self::AVSS_DRONE_IMU(..) => AVSS_DRONE_IMU_DATA::NAME,
34591 Self::AVSS_DRONE_OPERATION_MODE(..) => AVSS_DRONE_OPERATION_MODE_DATA::NAME,
34592 Self::AVSS_DRONE_POSITION(..) => AVSS_DRONE_POSITION_DATA::NAME,
34593 Self::AVSS_PRS_SYS_STATUS(..) => AVSS_PRS_SYS_STATUS_DATA::NAME,
34594 Self::BATTERY_INFO(..) => BATTERY_INFO_DATA::NAME,
34595 Self::BATTERY_STATUS(..) => BATTERY_STATUS_DATA::NAME,
34596 Self::BUTTON_CHANGE(..) => BUTTON_CHANGE_DATA::NAME,
34597 Self::CAMERA_CAPTURE_STATUS(..) => CAMERA_CAPTURE_STATUS_DATA::NAME,
34598 Self::CAMERA_FOV_STATUS(..) => CAMERA_FOV_STATUS_DATA::NAME,
34599 Self::CAMERA_IMAGE_CAPTURED(..) => CAMERA_IMAGE_CAPTURED_DATA::NAME,
34600 Self::CAMERA_INFORMATION(..) => CAMERA_INFORMATION_DATA::NAME,
34601 Self::CAMERA_SETTINGS(..) => CAMERA_SETTINGS_DATA::NAME,
34602 Self::CAMERA_THERMAL_RANGE(..) => CAMERA_THERMAL_RANGE_DATA::NAME,
34603 Self::CAMERA_TRACKING_GEO_STATUS(..) => CAMERA_TRACKING_GEO_STATUS_DATA::NAME,
34604 Self::CAMERA_TRACKING_IMAGE_STATUS(..) => CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME,
34605 Self::CAMERA_TRIGGER(..) => CAMERA_TRIGGER_DATA::NAME,
34606 Self::CANFD_FRAME(..) => CANFD_FRAME_DATA::NAME,
34607 Self::CAN_FILTER_MODIFY(..) => CAN_FILTER_MODIFY_DATA::NAME,
34608 Self::CAN_FRAME(..) => CAN_FRAME_DATA::NAME,
34609 Self::CELLULAR_CONFIG(..) => CELLULAR_CONFIG_DATA::NAME,
34610 Self::CELLULAR_STATUS(..) => CELLULAR_STATUS_DATA::NAME,
34611 Self::CHANGE_OPERATOR_CONTROL(..) => CHANGE_OPERATOR_CONTROL_DATA::NAME,
34612 Self::CHANGE_OPERATOR_CONTROL_ACK(..) => CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME,
34613 Self::COLLISION(..) => COLLISION_DATA::NAME,
34614 Self::COMMAND_ACK(..) => COMMAND_ACK_DATA::NAME,
34615 Self::COMMAND_CANCEL(..) => COMMAND_CANCEL_DATA::NAME,
34616 Self::COMMAND_INT(..) => COMMAND_INT_DATA::NAME,
34617 Self::COMMAND_LONG(..) => COMMAND_LONG_DATA::NAME,
34618 Self::COMPONENT_INFORMATION(..) => COMPONENT_INFORMATION_DATA::NAME,
34619 Self::COMPONENT_INFORMATION_BASIC(..) => COMPONENT_INFORMATION_BASIC_DATA::NAME,
34620 Self::COMPONENT_METADATA(..) => COMPONENT_METADATA_DATA::NAME,
34621 Self::CONTROL_SYSTEM_STATE(..) => CONTROL_SYSTEM_STATE_DATA::NAME,
34622 Self::CURRENT_EVENT_SEQUENCE(..) => CURRENT_EVENT_SEQUENCE_DATA::NAME,
34623 Self::CURRENT_MODE(..) => CURRENT_MODE_DATA::NAME,
34624 Self::DATA_STREAM(..) => DATA_STREAM_DATA::NAME,
34625 Self::DATA_TRANSMISSION_HANDSHAKE(..) => DATA_TRANSMISSION_HANDSHAKE_DATA::NAME,
34626 Self::DEBUG(..) => DEBUG_DATA::NAME,
34627 Self::DEBUG_FLOAT_ARRAY(..) => DEBUG_FLOAT_ARRAY_DATA::NAME,
34628 Self::DEBUG_VECT(..) => DEBUG_VECT_DATA::NAME,
34629 Self::DISTANCE_SENSOR(..) => DISTANCE_SENSOR_DATA::NAME,
34630 Self::EFI_STATUS(..) => EFI_STATUS_DATA::NAME,
34631 Self::ENCAPSULATED_DATA(..) => ENCAPSULATED_DATA_DATA::NAME,
34632 Self::ESC_INFO(..) => ESC_INFO_DATA::NAME,
34633 Self::ESC_STATUS(..) => ESC_STATUS_DATA::NAME,
34634 Self::ESTIMATOR_STATUS(..) => ESTIMATOR_STATUS_DATA::NAME,
34635 Self::EVENT(..) => EVENT_DATA::NAME,
34636 Self::EXTENDED_SYS_STATE(..) => EXTENDED_SYS_STATE_DATA::NAME,
34637 Self::FENCE_STATUS(..) => FENCE_STATUS_DATA::NAME,
34638 Self::FILE_TRANSFER_PROTOCOL(..) => FILE_TRANSFER_PROTOCOL_DATA::NAME,
34639 Self::FLIGHT_INFORMATION(..) => FLIGHT_INFORMATION_DATA::NAME,
34640 Self::FOLLOW_TARGET(..) => FOLLOW_TARGET_DATA::NAME,
34641 Self::FUEL_STATUS(..) => FUEL_STATUS_DATA::NAME,
34642 Self::GENERATOR_STATUS(..) => GENERATOR_STATUS_DATA::NAME,
34643 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(..) => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME,
34644 Self::GIMBAL_DEVICE_INFORMATION(..) => GIMBAL_DEVICE_INFORMATION_DATA::NAME,
34645 Self::GIMBAL_DEVICE_SET_ATTITUDE(..) => GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME,
34646 Self::GIMBAL_MANAGER_INFORMATION(..) => GIMBAL_MANAGER_INFORMATION_DATA::NAME,
34647 Self::GIMBAL_MANAGER_SET_ATTITUDE(..) => GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME,
34648 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(..) => {
34649 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME
34650 }
34651 Self::GIMBAL_MANAGER_SET_PITCHYAW(..) => GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME,
34652 Self::GIMBAL_MANAGER_STATUS(..) => GIMBAL_MANAGER_STATUS_DATA::NAME,
34653 Self::GLOBAL_POSITION_INT(..) => GLOBAL_POSITION_INT_DATA::NAME,
34654 Self::GLOBAL_POSITION_INT_COV(..) => GLOBAL_POSITION_INT_COV_DATA::NAME,
34655 Self::GLOBAL_VISION_POSITION_ESTIMATE(..) => GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME,
34656 Self::GPS2_RAW(..) => GPS2_RAW_DATA::NAME,
34657 Self::GPS2_RTK(..) => GPS2_RTK_DATA::NAME,
34658 Self::GPS_GLOBAL_ORIGIN(..) => GPS_GLOBAL_ORIGIN_DATA::NAME,
34659 Self::GPS_INJECT_DATA(..) => GPS_INJECT_DATA_DATA::NAME,
34660 Self::GPS_INPUT(..) => GPS_INPUT_DATA::NAME,
34661 Self::GPS_RAW_INT(..) => GPS_RAW_INT_DATA::NAME,
34662 Self::GPS_RTCM_DATA(..) => GPS_RTCM_DATA_DATA::NAME,
34663 Self::GPS_RTK(..) => GPS_RTK_DATA::NAME,
34664 Self::GPS_STATUS(..) => GPS_STATUS_DATA::NAME,
34665 Self::HEARTBEAT(..) => HEARTBEAT_DATA::NAME,
34666 Self::HIGHRES_IMU(..) => HIGHRES_IMU_DATA::NAME,
34667 Self::HIGH_LATENCY(..) => HIGH_LATENCY_DATA::NAME,
34668 Self::HIGH_LATENCY2(..) => HIGH_LATENCY2_DATA::NAME,
34669 Self::HIL_ACTUATOR_CONTROLS(..) => HIL_ACTUATOR_CONTROLS_DATA::NAME,
34670 Self::HIL_CONTROLS(..) => HIL_CONTROLS_DATA::NAME,
34671 Self::HIL_GPS(..) => HIL_GPS_DATA::NAME,
34672 Self::HIL_OPTICAL_FLOW(..) => HIL_OPTICAL_FLOW_DATA::NAME,
34673 Self::HIL_RC_INPUTS_RAW(..) => HIL_RC_INPUTS_RAW_DATA::NAME,
34674 Self::HIL_SENSOR(..) => HIL_SENSOR_DATA::NAME,
34675 Self::HIL_STATE(..) => HIL_STATE_DATA::NAME,
34676 Self::HIL_STATE_QUATERNION(..) => HIL_STATE_QUATERNION_DATA::NAME,
34677 Self::HOME_POSITION(..) => HOME_POSITION_DATA::NAME,
34678 Self::HYGROMETER_SENSOR(..) => HYGROMETER_SENSOR_DATA::NAME,
34679 Self::ILLUMINATOR_STATUS(..) => ILLUMINATOR_STATUS_DATA::NAME,
34680 Self::ISBD_LINK_STATUS(..) => ISBD_LINK_STATUS_DATA::NAME,
34681 Self::LANDING_TARGET(..) => LANDING_TARGET_DATA::NAME,
34682 Self::LINK_NODE_STATUS(..) => LINK_NODE_STATUS_DATA::NAME,
34683 Self::LOCAL_POSITION_NED(..) => LOCAL_POSITION_NED_DATA::NAME,
34684 Self::LOCAL_POSITION_NED_COV(..) => LOCAL_POSITION_NED_COV_DATA::NAME,
34685 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(..) => {
34686 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME
34687 }
34688 Self::LOGGING_ACK(..) => LOGGING_ACK_DATA::NAME,
34689 Self::LOGGING_DATA(..) => LOGGING_DATA_DATA::NAME,
34690 Self::LOGGING_DATA_ACKED(..) => LOGGING_DATA_ACKED_DATA::NAME,
34691 Self::LOG_DATA(..) => LOG_DATA_DATA::NAME,
34692 Self::LOG_ENTRY(..) => LOG_ENTRY_DATA::NAME,
34693 Self::LOG_ERASE(..) => LOG_ERASE_DATA::NAME,
34694 Self::LOG_REQUEST_DATA(..) => LOG_REQUEST_DATA_DATA::NAME,
34695 Self::LOG_REQUEST_END(..) => LOG_REQUEST_END_DATA::NAME,
34696 Self::LOG_REQUEST_LIST(..) => LOG_REQUEST_LIST_DATA::NAME,
34697 Self::MAG_CAL_REPORT(..) => MAG_CAL_REPORT_DATA::NAME,
34698 Self::MANUAL_CONTROL(..) => MANUAL_CONTROL_DATA::NAME,
34699 Self::MANUAL_SETPOINT(..) => MANUAL_SETPOINT_DATA::NAME,
34700 Self::MEMORY_VECT(..) => MEMORY_VECT_DATA::NAME,
34701 Self::MESSAGE_INTERVAL(..) => MESSAGE_INTERVAL_DATA::NAME,
34702 Self::MISSION_ACK(..) => MISSION_ACK_DATA::NAME,
34703 Self::MISSION_CLEAR_ALL(..) => MISSION_CLEAR_ALL_DATA::NAME,
34704 Self::MISSION_COUNT(..) => MISSION_COUNT_DATA::NAME,
34705 Self::MISSION_CURRENT(..) => MISSION_CURRENT_DATA::NAME,
34706 Self::MISSION_ITEM(..) => MISSION_ITEM_DATA::NAME,
34707 Self::MISSION_ITEM_INT(..) => MISSION_ITEM_INT_DATA::NAME,
34708 Self::MISSION_ITEM_REACHED(..) => MISSION_ITEM_REACHED_DATA::NAME,
34709 Self::MISSION_REQUEST(..) => MISSION_REQUEST_DATA::NAME,
34710 Self::MISSION_REQUEST_INT(..) => MISSION_REQUEST_INT_DATA::NAME,
34711 Self::MISSION_REQUEST_LIST(..) => MISSION_REQUEST_LIST_DATA::NAME,
34712 Self::MISSION_REQUEST_PARTIAL_LIST(..) => MISSION_REQUEST_PARTIAL_LIST_DATA::NAME,
34713 Self::MISSION_SET_CURRENT(..) => MISSION_SET_CURRENT_DATA::NAME,
34714 Self::MISSION_WRITE_PARTIAL_LIST(..) => MISSION_WRITE_PARTIAL_LIST_DATA::NAME,
34715 Self::MOUNT_ORIENTATION(..) => MOUNT_ORIENTATION_DATA::NAME,
34716 Self::NAMED_VALUE_FLOAT(..) => NAMED_VALUE_FLOAT_DATA::NAME,
34717 Self::NAMED_VALUE_INT(..) => NAMED_VALUE_INT_DATA::NAME,
34718 Self::NAV_CONTROLLER_OUTPUT(..) => NAV_CONTROLLER_OUTPUT_DATA::NAME,
34719 Self::OBSTACLE_DISTANCE(..) => OBSTACLE_DISTANCE_DATA::NAME,
34720 Self::ODOMETRY(..) => ODOMETRY_DATA::NAME,
34721 Self::ONBOARD_COMPUTER_STATUS(..) => ONBOARD_COMPUTER_STATUS_DATA::NAME,
34722 Self::OPEN_DRONE_ID_ARM_STATUS(..) => OPEN_DRONE_ID_ARM_STATUS_DATA::NAME,
34723 Self::OPEN_DRONE_ID_AUTHENTICATION(..) => OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME,
34724 Self::OPEN_DRONE_ID_BASIC_ID(..) => OPEN_DRONE_ID_BASIC_ID_DATA::NAME,
34725 Self::OPEN_DRONE_ID_LOCATION(..) => OPEN_DRONE_ID_LOCATION_DATA::NAME,
34726 Self::OPEN_DRONE_ID_MESSAGE_PACK(..) => OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME,
34727 Self::OPEN_DRONE_ID_OPERATOR_ID(..) => OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME,
34728 Self::OPEN_DRONE_ID_SELF_ID(..) => OPEN_DRONE_ID_SELF_ID_DATA::NAME,
34729 Self::OPEN_DRONE_ID_SYSTEM(..) => OPEN_DRONE_ID_SYSTEM_DATA::NAME,
34730 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(..) => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME,
34731 Self::OPTICAL_FLOW(..) => OPTICAL_FLOW_DATA::NAME,
34732 Self::OPTICAL_FLOW_RAD(..) => OPTICAL_FLOW_RAD_DATA::NAME,
34733 Self::ORBIT_EXECUTION_STATUS(..) => ORBIT_EXECUTION_STATUS_DATA::NAME,
34734 Self::PARAM_EXT_ACK(..) => PARAM_EXT_ACK_DATA::NAME,
34735 Self::PARAM_EXT_REQUEST_LIST(..) => PARAM_EXT_REQUEST_LIST_DATA::NAME,
34736 Self::PARAM_EXT_REQUEST_READ(..) => PARAM_EXT_REQUEST_READ_DATA::NAME,
34737 Self::PARAM_EXT_SET(..) => PARAM_EXT_SET_DATA::NAME,
34738 Self::PARAM_EXT_VALUE(..) => PARAM_EXT_VALUE_DATA::NAME,
34739 Self::PARAM_MAP_RC(..) => PARAM_MAP_RC_DATA::NAME,
34740 Self::PARAM_REQUEST_LIST(..) => PARAM_REQUEST_LIST_DATA::NAME,
34741 Self::PARAM_REQUEST_READ(..) => PARAM_REQUEST_READ_DATA::NAME,
34742 Self::PARAM_SET(..) => PARAM_SET_DATA::NAME,
34743 Self::PARAM_VALUE(..) => PARAM_VALUE_DATA::NAME,
34744 Self::PING(..) => PING_DATA::NAME,
34745 Self::PLAY_TUNE(..) => PLAY_TUNE_DATA::NAME,
34746 Self::PLAY_TUNE_V2(..) => PLAY_TUNE_V2_DATA::NAME,
34747 Self::POSITION_TARGET_GLOBAL_INT(..) => POSITION_TARGET_GLOBAL_INT_DATA::NAME,
34748 Self::POSITION_TARGET_LOCAL_NED(..) => POSITION_TARGET_LOCAL_NED_DATA::NAME,
34749 Self::POWER_STATUS(..) => POWER_STATUS_DATA::NAME,
34750 Self::PROTOCOL_VERSION(..) => PROTOCOL_VERSION_DATA::NAME,
34751 Self::RADIO_STATUS(..) => RADIO_STATUS_DATA::NAME,
34752 Self::RAW_IMU(..) => RAW_IMU_DATA::NAME,
34753 Self::RAW_PRESSURE(..) => RAW_PRESSURE_DATA::NAME,
34754 Self::RAW_RPM(..) => RAW_RPM_DATA::NAME,
34755 Self::RC_CHANNELS(..) => RC_CHANNELS_DATA::NAME,
34756 Self::RC_CHANNELS_OVERRIDE(..) => RC_CHANNELS_OVERRIDE_DATA::NAME,
34757 Self::RC_CHANNELS_RAW(..) => RC_CHANNELS_RAW_DATA::NAME,
34758 Self::RC_CHANNELS_SCALED(..) => RC_CHANNELS_SCALED_DATA::NAME,
34759 Self::REQUEST_DATA_STREAM(..) => REQUEST_DATA_STREAM_DATA::NAME,
34760 Self::REQUEST_EVENT(..) => REQUEST_EVENT_DATA::NAME,
34761 Self::RESOURCE_REQUEST(..) => RESOURCE_REQUEST_DATA::NAME,
34762 Self::RESPONSE_EVENT_ERROR(..) => RESPONSE_EVENT_ERROR_DATA::NAME,
34763 Self::SAFETY_ALLOWED_AREA(..) => SAFETY_ALLOWED_AREA_DATA::NAME,
34764 Self::SAFETY_SET_ALLOWED_AREA(..) => SAFETY_SET_ALLOWED_AREA_DATA::NAME,
34765 Self::SCALED_IMU(..) => SCALED_IMU_DATA::NAME,
34766 Self::SCALED_IMU2(..) => SCALED_IMU2_DATA::NAME,
34767 Self::SCALED_IMU3(..) => SCALED_IMU3_DATA::NAME,
34768 Self::SCALED_PRESSURE(..) => SCALED_PRESSURE_DATA::NAME,
34769 Self::SCALED_PRESSURE2(..) => SCALED_PRESSURE2_DATA::NAME,
34770 Self::SCALED_PRESSURE3(..) => SCALED_PRESSURE3_DATA::NAME,
34771 Self::SERIAL_CONTROL(..) => SERIAL_CONTROL_DATA::NAME,
34772 Self::SERVO_OUTPUT_RAW(..) => SERVO_OUTPUT_RAW_DATA::NAME,
34773 Self::SETUP_SIGNING(..) => SETUP_SIGNING_DATA::NAME,
34774 Self::SET_ACTUATOR_CONTROL_TARGET(..) => SET_ACTUATOR_CONTROL_TARGET_DATA::NAME,
34775 Self::SET_ATTITUDE_TARGET(..) => SET_ATTITUDE_TARGET_DATA::NAME,
34776 Self::SET_GPS_GLOBAL_ORIGIN(..) => SET_GPS_GLOBAL_ORIGIN_DATA::NAME,
34777 Self::SET_HOME_POSITION(..) => SET_HOME_POSITION_DATA::NAME,
34778 Self::SET_MODE(..) => SET_MODE_DATA::NAME,
34779 Self::SET_POSITION_TARGET_GLOBAL_INT(..) => SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME,
34780 Self::SET_POSITION_TARGET_LOCAL_NED(..) => SET_POSITION_TARGET_LOCAL_NED_DATA::NAME,
34781 Self::SIM_STATE(..) => SIM_STATE_DATA::NAME,
34782 Self::SMART_BATTERY_INFO(..) => SMART_BATTERY_INFO_DATA::NAME,
34783 Self::STATUSTEXT(..) => STATUSTEXT_DATA::NAME,
34784 Self::STORAGE_INFORMATION(..) => STORAGE_INFORMATION_DATA::NAME,
34785 Self::SUPPORTED_TUNES(..) => SUPPORTED_TUNES_DATA::NAME,
34786 Self::SYSTEM_TIME(..) => SYSTEM_TIME_DATA::NAME,
34787 Self::SYS_STATUS(..) => SYS_STATUS_DATA::NAME,
34788 Self::TERRAIN_CHECK(..) => TERRAIN_CHECK_DATA::NAME,
34789 Self::TERRAIN_DATA(..) => TERRAIN_DATA_DATA::NAME,
34790 Self::TERRAIN_REPORT(..) => TERRAIN_REPORT_DATA::NAME,
34791 Self::TERRAIN_REQUEST(..) => TERRAIN_REQUEST_DATA::NAME,
34792 Self::TIMESYNC(..) => TIMESYNC_DATA::NAME,
34793 Self::TIME_ESTIMATE_TO_TARGET(..) => TIME_ESTIMATE_TO_TARGET_DATA::NAME,
34794 Self::TRAJECTORY_REPRESENTATION_BEZIER(..) => {
34795 TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME
34796 }
34797 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(..) => {
34798 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME
34799 }
34800 Self::TUNNEL(..) => TUNNEL_DATA::NAME,
34801 Self::UAVCAN_NODE_INFO(..) => UAVCAN_NODE_INFO_DATA::NAME,
34802 Self::UAVCAN_NODE_STATUS(..) => UAVCAN_NODE_STATUS_DATA::NAME,
34803 Self::UTM_GLOBAL_POSITION(..) => UTM_GLOBAL_POSITION_DATA::NAME,
34804 Self::V2_EXTENSION(..) => V2_EXTENSION_DATA::NAME,
34805 Self::VFR_HUD(..) => VFR_HUD_DATA::NAME,
34806 Self::VIBRATION(..) => VIBRATION_DATA::NAME,
34807 Self::VICON_POSITION_ESTIMATE(..) => VICON_POSITION_ESTIMATE_DATA::NAME,
34808 Self::VIDEO_STREAM_INFORMATION(..) => VIDEO_STREAM_INFORMATION_DATA::NAME,
34809 Self::VIDEO_STREAM_STATUS(..) => VIDEO_STREAM_STATUS_DATA::NAME,
34810 Self::VISION_POSITION_ESTIMATE(..) => VISION_POSITION_ESTIMATE_DATA::NAME,
34811 Self::VISION_SPEED_ESTIMATE(..) => VISION_SPEED_ESTIMATE_DATA::NAME,
34812 Self::WHEEL_DISTANCE(..) => WHEEL_DISTANCE_DATA::NAME,
34813 Self::WIFI_CONFIG_AP(..) => WIFI_CONFIG_AP_DATA::NAME,
34814 Self::WINCH_STATUS(..) => WINCH_STATUS_DATA::NAME,
34815 Self::WIND_COV(..) => WIND_COV_DATA::NAME,
34816 }
34817 }
34818 fn message_id(&self) -> u32 {
34819 match self {
34820 Self::ACTUATOR_CONTROL_TARGET(..) => ACTUATOR_CONTROL_TARGET_DATA::ID,
34821 Self::ACTUATOR_OUTPUT_STATUS(..) => ACTUATOR_OUTPUT_STATUS_DATA::ID,
34822 Self::ADSB_VEHICLE(..) => ADSB_VEHICLE_DATA::ID,
34823 Self::AIS_VESSEL(..) => AIS_VESSEL_DATA::ID,
34824 Self::ALTITUDE(..) => ALTITUDE_DATA::ID,
34825 Self::ATTITUDE(..) => ATTITUDE_DATA::ID,
34826 Self::ATTITUDE_QUATERNION(..) => ATTITUDE_QUATERNION_DATA::ID,
34827 Self::ATTITUDE_QUATERNION_COV(..) => ATTITUDE_QUATERNION_COV_DATA::ID,
34828 Self::ATTITUDE_TARGET(..) => ATTITUDE_TARGET_DATA::ID,
34829 Self::ATT_POS_MOCAP(..) => ATT_POS_MOCAP_DATA::ID,
34830 Self::AUTH_KEY(..) => AUTH_KEY_DATA::ID,
34831 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(..) => {
34832 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID
34833 }
34834 Self::AUTOPILOT_VERSION(..) => AUTOPILOT_VERSION_DATA::ID,
34835 Self::AVAILABLE_MODES(..) => AVAILABLE_MODES_DATA::ID,
34836 Self::AVAILABLE_MODES_MONITOR(..) => AVAILABLE_MODES_MONITOR_DATA::ID,
34837 Self::AVSS_DRONE_IMU(..) => AVSS_DRONE_IMU_DATA::ID,
34838 Self::AVSS_DRONE_OPERATION_MODE(..) => AVSS_DRONE_OPERATION_MODE_DATA::ID,
34839 Self::AVSS_DRONE_POSITION(..) => AVSS_DRONE_POSITION_DATA::ID,
34840 Self::AVSS_PRS_SYS_STATUS(..) => AVSS_PRS_SYS_STATUS_DATA::ID,
34841 Self::BATTERY_INFO(..) => BATTERY_INFO_DATA::ID,
34842 Self::BATTERY_STATUS(..) => BATTERY_STATUS_DATA::ID,
34843 Self::BUTTON_CHANGE(..) => BUTTON_CHANGE_DATA::ID,
34844 Self::CAMERA_CAPTURE_STATUS(..) => CAMERA_CAPTURE_STATUS_DATA::ID,
34845 Self::CAMERA_FOV_STATUS(..) => CAMERA_FOV_STATUS_DATA::ID,
34846 Self::CAMERA_IMAGE_CAPTURED(..) => CAMERA_IMAGE_CAPTURED_DATA::ID,
34847 Self::CAMERA_INFORMATION(..) => CAMERA_INFORMATION_DATA::ID,
34848 Self::CAMERA_SETTINGS(..) => CAMERA_SETTINGS_DATA::ID,
34849 Self::CAMERA_THERMAL_RANGE(..) => CAMERA_THERMAL_RANGE_DATA::ID,
34850 Self::CAMERA_TRACKING_GEO_STATUS(..) => CAMERA_TRACKING_GEO_STATUS_DATA::ID,
34851 Self::CAMERA_TRACKING_IMAGE_STATUS(..) => CAMERA_TRACKING_IMAGE_STATUS_DATA::ID,
34852 Self::CAMERA_TRIGGER(..) => CAMERA_TRIGGER_DATA::ID,
34853 Self::CANFD_FRAME(..) => CANFD_FRAME_DATA::ID,
34854 Self::CAN_FILTER_MODIFY(..) => CAN_FILTER_MODIFY_DATA::ID,
34855 Self::CAN_FRAME(..) => CAN_FRAME_DATA::ID,
34856 Self::CELLULAR_CONFIG(..) => CELLULAR_CONFIG_DATA::ID,
34857 Self::CELLULAR_STATUS(..) => CELLULAR_STATUS_DATA::ID,
34858 Self::CHANGE_OPERATOR_CONTROL(..) => CHANGE_OPERATOR_CONTROL_DATA::ID,
34859 Self::CHANGE_OPERATOR_CONTROL_ACK(..) => CHANGE_OPERATOR_CONTROL_ACK_DATA::ID,
34860 Self::COLLISION(..) => COLLISION_DATA::ID,
34861 Self::COMMAND_ACK(..) => COMMAND_ACK_DATA::ID,
34862 Self::COMMAND_CANCEL(..) => COMMAND_CANCEL_DATA::ID,
34863 Self::COMMAND_INT(..) => COMMAND_INT_DATA::ID,
34864 Self::COMMAND_LONG(..) => COMMAND_LONG_DATA::ID,
34865 Self::COMPONENT_INFORMATION(..) => COMPONENT_INFORMATION_DATA::ID,
34866 Self::COMPONENT_INFORMATION_BASIC(..) => COMPONENT_INFORMATION_BASIC_DATA::ID,
34867 Self::COMPONENT_METADATA(..) => COMPONENT_METADATA_DATA::ID,
34868 Self::CONTROL_SYSTEM_STATE(..) => CONTROL_SYSTEM_STATE_DATA::ID,
34869 Self::CURRENT_EVENT_SEQUENCE(..) => CURRENT_EVENT_SEQUENCE_DATA::ID,
34870 Self::CURRENT_MODE(..) => CURRENT_MODE_DATA::ID,
34871 Self::DATA_STREAM(..) => DATA_STREAM_DATA::ID,
34872 Self::DATA_TRANSMISSION_HANDSHAKE(..) => DATA_TRANSMISSION_HANDSHAKE_DATA::ID,
34873 Self::DEBUG(..) => DEBUG_DATA::ID,
34874 Self::DEBUG_FLOAT_ARRAY(..) => DEBUG_FLOAT_ARRAY_DATA::ID,
34875 Self::DEBUG_VECT(..) => DEBUG_VECT_DATA::ID,
34876 Self::DISTANCE_SENSOR(..) => DISTANCE_SENSOR_DATA::ID,
34877 Self::EFI_STATUS(..) => EFI_STATUS_DATA::ID,
34878 Self::ENCAPSULATED_DATA(..) => ENCAPSULATED_DATA_DATA::ID,
34879 Self::ESC_INFO(..) => ESC_INFO_DATA::ID,
34880 Self::ESC_STATUS(..) => ESC_STATUS_DATA::ID,
34881 Self::ESTIMATOR_STATUS(..) => ESTIMATOR_STATUS_DATA::ID,
34882 Self::EVENT(..) => EVENT_DATA::ID,
34883 Self::EXTENDED_SYS_STATE(..) => EXTENDED_SYS_STATE_DATA::ID,
34884 Self::FENCE_STATUS(..) => FENCE_STATUS_DATA::ID,
34885 Self::FILE_TRANSFER_PROTOCOL(..) => FILE_TRANSFER_PROTOCOL_DATA::ID,
34886 Self::FLIGHT_INFORMATION(..) => FLIGHT_INFORMATION_DATA::ID,
34887 Self::FOLLOW_TARGET(..) => FOLLOW_TARGET_DATA::ID,
34888 Self::FUEL_STATUS(..) => FUEL_STATUS_DATA::ID,
34889 Self::GENERATOR_STATUS(..) => GENERATOR_STATUS_DATA::ID,
34890 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(..) => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID,
34891 Self::GIMBAL_DEVICE_INFORMATION(..) => GIMBAL_DEVICE_INFORMATION_DATA::ID,
34892 Self::GIMBAL_DEVICE_SET_ATTITUDE(..) => GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID,
34893 Self::GIMBAL_MANAGER_INFORMATION(..) => GIMBAL_MANAGER_INFORMATION_DATA::ID,
34894 Self::GIMBAL_MANAGER_SET_ATTITUDE(..) => GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID,
34895 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(..) => {
34896 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID
34897 }
34898 Self::GIMBAL_MANAGER_SET_PITCHYAW(..) => GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID,
34899 Self::GIMBAL_MANAGER_STATUS(..) => GIMBAL_MANAGER_STATUS_DATA::ID,
34900 Self::GLOBAL_POSITION_INT(..) => GLOBAL_POSITION_INT_DATA::ID,
34901 Self::GLOBAL_POSITION_INT_COV(..) => GLOBAL_POSITION_INT_COV_DATA::ID,
34902 Self::GLOBAL_VISION_POSITION_ESTIMATE(..) => GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID,
34903 Self::GPS2_RAW(..) => GPS2_RAW_DATA::ID,
34904 Self::GPS2_RTK(..) => GPS2_RTK_DATA::ID,
34905 Self::GPS_GLOBAL_ORIGIN(..) => GPS_GLOBAL_ORIGIN_DATA::ID,
34906 Self::GPS_INJECT_DATA(..) => GPS_INJECT_DATA_DATA::ID,
34907 Self::GPS_INPUT(..) => GPS_INPUT_DATA::ID,
34908 Self::GPS_RAW_INT(..) => GPS_RAW_INT_DATA::ID,
34909 Self::GPS_RTCM_DATA(..) => GPS_RTCM_DATA_DATA::ID,
34910 Self::GPS_RTK(..) => GPS_RTK_DATA::ID,
34911 Self::GPS_STATUS(..) => GPS_STATUS_DATA::ID,
34912 Self::HEARTBEAT(..) => HEARTBEAT_DATA::ID,
34913 Self::HIGHRES_IMU(..) => HIGHRES_IMU_DATA::ID,
34914 Self::HIGH_LATENCY(..) => HIGH_LATENCY_DATA::ID,
34915 Self::HIGH_LATENCY2(..) => HIGH_LATENCY2_DATA::ID,
34916 Self::HIL_ACTUATOR_CONTROLS(..) => HIL_ACTUATOR_CONTROLS_DATA::ID,
34917 Self::HIL_CONTROLS(..) => HIL_CONTROLS_DATA::ID,
34918 Self::HIL_GPS(..) => HIL_GPS_DATA::ID,
34919 Self::HIL_OPTICAL_FLOW(..) => HIL_OPTICAL_FLOW_DATA::ID,
34920 Self::HIL_RC_INPUTS_RAW(..) => HIL_RC_INPUTS_RAW_DATA::ID,
34921 Self::HIL_SENSOR(..) => HIL_SENSOR_DATA::ID,
34922 Self::HIL_STATE(..) => HIL_STATE_DATA::ID,
34923 Self::HIL_STATE_QUATERNION(..) => HIL_STATE_QUATERNION_DATA::ID,
34924 Self::HOME_POSITION(..) => HOME_POSITION_DATA::ID,
34925 Self::HYGROMETER_SENSOR(..) => HYGROMETER_SENSOR_DATA::ID,
34926 Self::ILLUMINATOR_STATUS(..) => ILLUMINATOR_STATUS_DATA::ID,
34927 Self::ISBD_LINK_STATUS(..) => ISBD_LINK_STATUS_DATA::ID,
34928 Self::LANDING_TARGET(..) => LANDING_TARGET_DATA::ID,
34929 Self::LINK_NODE_STATUS(..) => LINK_NODE_STATUS_DATA::ID,
34930 Self::LOCAL_POSITION_NED(..) => LOCAL_POSITION_NED_DATA::ID,
34931 Self::LOCAL_POSITION_NED_COV(..) => LOCAL_POSITION_NED_COV_DATA::ID,
34932 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(..) => {
34933 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID
34934 }
34935 Self::LOGGING_ACK(..) => LOGGING_ACK_DATA::ID,
34936 Self::LOGGING_DATA(..) => LOGGING_DATA_DATA::ID,
34937 Self::LOGGING_DATA_ACKED(..) => LOGGING_DATA_ACKED_DATA::ID,
34938 Self::LOG_DATA(..) => LOG_DATA_DATA::ID,
34939 Self::LOG_ENTRY(..) => LOG_ENTRY_DATA::ID,
34940 Self::LOG_ERASE(..) => LOG_ERASE_DATA::ID,
34941 Self::LOG_REQUEST_DATA(..) => LOG_REQUEST_DATA_DATA::ID,
34942 Self::LOG_REQUEST_END(..) => LOG_REQUEST_END_DATA::ID,
34943 Self::LOG_REQUEST_LIST(..) => LOG_REQUEST_LIST_DATA::ID,
34944 Self::MAG_CAL_REPORT(..) => MAG_CAL_REPORT_DATA::ID,
34945 Self::MANUAL_CONTROL(..) => MANUAL_CONTROL_DATA::ID,
34946 Self::MANUAL_SETPOINT(..) => MANUAL_SETPOINT_DATA::ID,
34947 Self::MEMORY_VECT(..) => MEMORY_VECT_DATA::ID,
34948 Self::MESSAGE_INTERVAL(..) => MESSAGE_INTERVAL_DATA::ID,
34949 Self::MISSION_ACK(..) => MISSION_ACK_DATA::ID,
34950 Self::MISSION_CLEAR_ALL(..) => MISSION_CLEAR_ALL_DATA::ID,
34951 Self::MISSION_COUNT(..) => MISSION_COUNT_DATA::ID,
34952 Self::MISSION_CURRENT(..) => MISSION_CURRENT_DATA::ID,
34953 Self::MISSION_ITEM(..) => MISSION_ITEM_DATA::ID,
34954 Self::MISSION_ITEM_INT(..) => MISSION_ITEM_INT_DATA::ID,
34955 Self::MISSION_ITEM_REACHED(..) => MISSION_ITEM_REACHED_DATA::ID,
34956 Self::MISSION_REQUEST(..) => MISSION_REQUEST_DATA::ID,
34957 Self::MISSION_REQUEST_INT(..) => MISSION_REQUEST_INT_DATA::ID,
34958 Self::MISSION_REQUEST_LIST(..) => MISSION_REQUEST_LIST_DATA::ID,
34959 Self::MISSION_REQUEST_PARTIAL_LIST(..) => MISSION_REQUEST_PARTIAL_LIST_DATA::ID,
34960 Self::MISSION_SET_CURRENT(..) => MISSION_SET_CURRENT_DATA::ID,
34961 Self::MISSION_WRITE_PARTIAL_LIST(..) => MISSION_WRITE_PARTIAL_LIST_DATA::ID,
34962 Self::MOUNT_ORIENTATION(..) => MOUNT_ORIENTATION_DATA::ID,
34963 Self::NAMED_VALUE_FLOAT(..) => NAMED_VALUE_FLOAT_DATA::ID,
34964 Self::NAMED_VALUE_INT(..) => NAMED_VALUE_INT_DATA::ID,
34965 Self::NAV_CONTROLLER_OUTPUT(..) => NAV_CONTROLLER_OUTPUT_DATA::ID,
34966 Self::OBSTACLE_DISTANCE(..) => OBSTACLE_DISTANCE_DATA::ID,
34967 Self::ODOMETRY(..) => ODOMETRY_DATA::ID,
34968 Self::ONBOARD_COMPUTER_STATUS(..) => ONBOARD_COMPUTER_STATUS_DATA::ID,
34969 Self::OPEN_DRONE_ID_ARM_STATUS(..) => OPEN_DRONE_ID_ARM_STATUS_DATA::ID,
34970 Self::OPEN_DRONE_ID_AUTHENTICATION(..) => OPEN_DRONE_ID_AUTHENTICATION_DATA::ID,
34971 Self::OPEN_DRONE_ID_BASIC_ID(..) => OPEN_DRONE_ID_BASIC_ID_DATA::ID,
34972 Self::OPEN_DRONE_ID_LOCATION(..) => OPEN_DRONE_ID_LOCATION_DATA::ID,
34973 Self::OPEN_DRONE_ID_MESSAGE_PACK(..) => OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID,
34974 Self::OPEN_DRONE_ID_OPERATOR_ID(..) => OPEN_DRONE_ID_OPERATOR_ID_DATA::ID,
34975 Self::OPEN_DRONE_ID_SELF_ID(..) => OPEN_DRONE_ID_SELF_ID_DATA::ID,
34976 Self::OPEN_DRONE_ID_SYSTEM(..) => OPEN_DRONE_ID_SYSTEM_DATA::ID,
34977 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(..) => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID,
34978 Self::OPTICAL_FLOW(..) => OPTICAL_FLOW_DATA::ID,
34979 Self::OPTICAL_FLOW_RAD(..) => OPTICAL_FLOW_RAD_DATA::ID,
34980 Self::ORBIT_EXECUTION_STATUS(..) => ORBIT_EXECUTION_STATUS_DATA::ID,
34981 Self::PARAM_EXT_ACK(..) => PARAM_EXT_ACK_DATA::ID,
34982 Self::PARAM_EXT_REQUEST_LIST(..) => PARAM_EXT_REQUEST_LIST_DATA::ID,
34983 Self::PARAM_EXT_REQUEST_READ(..) => PARAM_EXT_REQUEST_READ_DATA::ID,
34984 Self::PARAM_EXT_SET(..) => PARAM_EXT_SET_DATA::ID,
34985 Self::PARAM_EXT_VALUE(..) => PARAM_EXT_VALUE_DATA::ID,
34986 Self::PARAM_MAP_RC(..) => PARAM_MAP_RC_DATA::ID,
34987 Self::PARAM_REQUEST_LIST(..) => PARAM_REQUEST_LIST_DATA::ID,
34988 Self::PARAM_REQUEST_READ(..) => PARAM_REQUEST_READ_DATA::ID,
34989 Self::PARAM_SET(..) => PARAM_SET_DATA::ID,
34990 Self::PARAM_VALUE(..) => PARAM_VALUE_DATA::ID,
34991 Self::PING(..) => PING_DATA::ID,
34992 Self::PLAY_TUNE(..) => PLAY_TUNE_DATA::ID,
34993 Self::PLAY_TUNE_V2(..) => PLAY_TUNE_V2_DATA::ID,
34994 Self::POSITION_TARGET_GLOBAL_INT(..) => POSITION_TARGET_GLOBAL_INT_DATA::ID,
34995 Self::POSITION_TARGET_LOCAL_NED(..) => POSITION_TARGET_LOCAL_NED_DATA::ID,
34996 Self::POWER_STATUS(..) => POWER_STATUS_DATA::ID,
34997 Self::PROTOCOL_VERSION(..) => PROTOCOL_VERSION_DATA::ID,
34998 Self::RADIO_STATUS(..) => RADIO_STATUS_DATA::ID,
34999 Self::RAW_IMU(..) => RAW_IMU_DATA::ID,
35000 Self::RAW_PRESSURE(..) => RAW_PRESSURE_DATA::ID,
35001 Self::RAW_RPM(..) => RAW_RPM_DATA::ID,
35002 Self::RC_CHANNELS(..) => RC_CHANNELS_DATA::ID,
35003 Self::RC_CHANNELS_OVERRIDE(..) => RC_CHANNELS_OVERRIDE_DATA::ID,
35004 Self::RC_CHANNELS_RAW(..) => RC_CHANNELS_RAW_DATA::ID,
35005 Self::RC_CHANNELS_SCALED(..) => RC_CHANNELS_SCALED_DATA::ID,
35006 Self::REQUEST_DATA_STREAM(..) => REQUEST_DATA_STREAM_DATA::ID,
35007 Self::REQUEST_EVENT(..) => REQUEST_EVENT_DATA::ID,
35008 Self::RESOURCE_REQUEST(..) => RESOURCE_REQUEST_DATA::ID,
35009 Self::RESPONSE_EVENT_ERROR(..) => RESPONSE_EVENT_ERROR_DATA::ID,
35010 Self::SAFETY_ALLOWED_AREA(..) => SAFETY_ALLOWED_AREA_DATA::ID,
35011 Self::SAFETY_SET_ALLOWED_AREA(..) => SAFETY_SET_ALLOWED_AREA_DATA::ID,
35012 Self::SCALED_IMU(..) => SCALED_IMU_DATA::ID,
35013 Self::SCALED_IMU2(..) => SCALED_IMU2_DATA::ID,
35014 Self::SCALED_IMU3(..) => SCALED_IMU3_DATA::ID,
35015 Self::SCALED_PRESSURE(..) => SCALED_PRESSURE_DATA::ID,
35016 Self::SCALED_PRESSURE2(..) => SCALED_PRESSURE2_DATA::ID,
35017 Self::SCALED_PRESSURE3(..) => SCALED_PRESSURE3_DATA::ID,
35018 Self::SERIAL_CONTROL(..) => SERIAL_CONTROL_DATA::ID,
35019 Self::SERVO_OUTPUT_RAW(..) => SERVO_OUTPUT_RAW_DATA::ID,
35020 Self::SETUP_SIGNING(..) => SETUP_SIGNING_DATA::ID,
35021 Self::SET_ACTUATOR_CONTROL_TARGET(..) => SET_ACTUATOR_CONTROL_TARGET_DATA::ID,
35022 Self::SET_ATTITUDE_TARGET(..) => SET_ATTITUDE_TARGET_DATA::ID,
35023 Self::SET_GPS_GLOBAL_ORIGIN(..) => SET_GPS_GLOBAL_ORIGIN_DATA::ID,
35024 Self::SET_HOME_POSITION(..) => SET_HOME_POSITION_DATA::ID,
35025 Self::SET_MODE(..) => SET_MODE_DATA::ID,
35026 Self::SET_POSITION_TARGET_GLOBAL_INT(..) => SET_POSITION_TARGET_GLOBAL_INT_DATA::ID,
35027 Self::SET_POSITION_TARGET_LOCAL_NED(..) => SET_POSITION_TARGET_LOCAL_NED_DATA::ID,
35028 Self::SIM_STATE(..) => SIM_STATE_DATA::ID,
35029 Self::SMART_BATTERY_INFO(..) => SMART_BATTERY_INFO_DATA::ID,
35030 Self::STATUSTEXT(..) => STATUSTEXT_DATA::ID,
35031 Self::STORAGE_INFORMATION(..) => STORAGE_INFORMATION_DATA::ID,
35032 Self::SUPPORTED_TUNES(..) => SUPPORTED_TUNES_DATA::ID,
35033 Self::SYSTEM_TIME(..) => SYSTEM_TIME_DATA::ID,
35034 Self::SYS_STATUS(..) => SYS_STATUS_DATA::ID,
35035 Self::TERRAIN_CHECK(..) => TERRAIN_CHECK_DATA::ID,
35036 Self::TERRAIN_DATA(..) => TERRAIN_DATA_DATA::ID,
35037 Self::TERRAIN_REPORT(..) => TERRAIN_REPORT_DATA::ID,
35038 Self::TERRAIN_REQUEST(..) => TERRAIN_REQUEST_DATA::ID,
35039 Self::TIMESYNC(..) => TIMESYNC_DATA::ID,
35040 Self::TIME_ESTIMATE_TO_TARGET(..) => TIME_ESTIMATE_TO_TARGET_DATA::ID,
35041 Self::TRAJECTORY_REPRESENTATION_BEZIER(..) => TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID,
35042 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(..) => {
35043 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID
35044 }
35045 Self::TUNNEL(..) => TUNNEL_DATA::ID,
35046 Self::UAVCAN_NODE_INFO(..) => UAVCAN_NODE_INFO_DATA::ID,
35047 Self::UAVCAN_NODE_STATUS(..) => UAVCAN_NODE_STATUS_DATA::ID,
35048 Self::UTM_GLOBAL_POSITION(..) => UTM_GLOBAL_POSITION_DATA::ID,
35049 Self::V2_EXTENSION(..) => V2_EXTENSION_DATA::ID,
35050 Self::VFR_HUD(..) => VFR_HUD_DATA::ID,
35051 Self::VIBRATION(..) => VIBRATION_DATA::ID,
35052 Self::VICON_POSITION_ESTIMATE(..) => VICON_POSITION_ESTIMATE_DATA::ID,
35053 Self::VIDEO_STREAM_INFORMATION(..) => VIDEO_STREAM_INFORMATION_DATA::ID,
35054 Self::VIDEO_STREAM_STATUS(..) => VIDEO_STREAM_STATUS_DATA::ID,
35055 Self::VISION_POSITION_ESTIMATE(..) => VISION_POSITION_ESTIMATE_DATA::ID,
35056 Self::VISION_SPEED_ESTIMATE(..) => VISION_SPEED_ESTIMATE_DATA::ID,
35057 Self::WHEEL_DISTANCE(..) => WHEEL_DISTANCE_DATA::ID,
35058 Self::WIFI_CONFIG_AP(..) => WIFI_CONFIG_AP_DATA::ID,
35059 Self::WINCH_STATUS(..) => WINCH_STATUS_DATA::ID,
35060 Self::WIND_COV(..) => WIND_COV_DATA::ID,
35061 }
35062 }
35063 fn message_id_from_name(name: &str) -> Option<u32> {
35064 match name {
35065 ACTUATOR_CONTROL_TARGET_DATA::NAME => Some(ACTUATOR_CONTROL_TARGET_DATA::ID),
35066 ACTUATOR_OUTPUT_STATUS_DATA::NAME => Some(ACTUATOR_OUTPUT_STATUS_DATA::ID),
35067 ADSB_VEHICLE_DATA::NAME => Some(ADSB_VEHICLE_DATA::ID),
35068 AIS_VESSEL_DATA::NAME => Some(AIS_VESSEL_DATA::ID),
35069 ALTITUDE_DATA::NAME => Some(ALTITUDE_DATA::ID),
35070 ATTITUDE_DATA::NAME => Some(ATTITUDE_DATA::ID),
35071 ATTITUDE_QUATERNION_DATA::NAME => Some(ATTITUDE_QUATERNION_DATA::ID),
35072 ATTITUDE_QUATERNION_COV_DATA::NAME => Some(ATTITUDE_QUATERNION_COV_DATA::ID),
35073 ATTITUDE_TARGET_DATA::NAME => Some(ATTITUDE_TARGET_DATA::ID),
35074 ATT_POS_MOCAP_DATA::NAME => Some(ATT_POS_MOCAP_DATA::ID),
35075 AUTH_KEY_DATA::NAME => Some(AUTH_KEY_DATA::ID),
35076 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME => {
35077 Some(AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID)
35078 }
35079 AUTOPILOT_VERSION_DATA::NAME => Some(AUTOPILOT_VERSION_DATA::ID),
35080 AVAILABLE_MODES_DATA::NAME => Some(AVAILABLE_MODES_DATA::ID),
35081 AVAILABLE_MODES_MONITOR_DATA::NAME => Some(AVAILABLE_MODES_MONITOR_DATA::ID),
35082 AVSS_DRONE_IMU_DATA::NAME => Some(AVSS_DRONE_IMU_DATA::ID),
35083 AVSS_DRONE_OPERATION_MODE_DATA::NAME => Some(AVSS_DRONE_OPERATION_MODE_DATA::ID),
35084 AVSS_DRONE_POSITION_DATA::NAME => Some(AVSS_DRONE_POSITION_DATA::ID),
35085 AVSS_PRS_SYS_STATUS_DATA::NAME => Some(AVSS_PRS_SYS_STATUS_DATA::ID),
35086 BATTERY_INFO_DATA::NAME => Some(BATTERY_INFO_DATA::ID),
35087 BATTERY_STATUS_DATA::NAME => Some(BATTERY_STATUS_DATA::ID),
35088 BUTTON_CHANGE_DATA::NAME => Some(BUTTON_CHANGE_DATA::ID),
35089 CAMERA_CAPTURE_STATUS_DATA::NAME => Some(CAMERA_CAPTURE_STATUS_DATA::ID),
35090 CAMERA_FOV_STATUS_DATA::NAME => Some(CAMERA_FOV_STATUS_DATA::ID),
35091 CAMERA_IMAGE_CAPTURED_DATA::NAME => Some(CAMERA_IMAGE_CAPTURED_DATA::ID),
35092 CAMERA_INFORMATION_DATA::NAME => Some(CAMERA_INFORMATION_DATA::ID),
35093 CAMERA_SETTINGS_DATA::NAME => Some(CAMERA_SETTINGS_DATA::ID),
35094 CAMERA_THERMAL_RANGE_DATA::NAME => Some(CAMERA_THERMAL_RANGE_DATA::ID),
35095 CAMERA_TRACKING_GEO_STATUS_DATA::NAME => Some(CAMERA_TRACKING_GEO_STATUS_DATA::ID),
35096 CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME => Some(CAMERA_TRACKING_IMAGE_STATUS_DATA::ID),
35097 CAMERA_TRIGGER_DATA::NAME => Some(CAMERA_TRIGGER_DATA::ID),
35098 CANFD_FRAME_DATA::NAME => Some(CANFD_FRAME_DATA::ID),
35099 CAN_FILTER_MODIFY_DATA::NAME => Some(CAN_FILTER_MODIFY_DATA::ID),
35100 CAN_FRAME_DATA::NAME => Some(CAN_FRAME_DATA::ID),
35101 CELLULAR_CONFIG_DATA::NAME => Some(CELLULAR_CONFIG_DATA::ID),
35102 CELLULAR_STATUS_DATA::NAME => Some(CELLULAR_STATUS_DATA::ID),
35103 CHANGE_OPERATOR_CONTROL_DATA::NAME => Some(CHANGE_OPERATOR_CONTROL_DATA::ID),
35104 CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME => Some(CHANGE_OPERATOR_CONTROL_ACK_DATA::ID),
35105 COLLISION_DATA::NAME => Some(COLLISION_DATA::ID),
35106 COMMAND_ACK_DATA::NAME => Some(COMMAND_ACK_DATA::ID),
35107 COMMAND_CANCEL_DATA::NAME => Some(COMMAND_CANCEL_DATA::ID),
35108 COMMAND_INT_DATA::NAME => Some(COMMAND_INT_DATA::ID),
35109 COMMAND_LONG_DATA::NAME => Some(COMMAND_LONG_DATA::ID),
35110 COMPONENT_INFORMATION_DATA::NAME => Some(COMPONENT_INFORMATION_DATA::ID),
35111 COMPONENT_INFORMATION_BASIC_DATA::NAME => Some(COMPONENT_INFORMATION_BASIC_DATA::ID),
35112 COMPONENT_METADATA_DATA::NAME => Some(COMPONENT_METADATA_DATA::ID),
35113 CONTROL_SYSTEM_STATE_DATA::NAME => Some(CONTROL_SYSTEM_STATE_DATA::ID),
35114 CURRENT_EVENT_SEQUENCE_DATA::NAME => Some(CURRENT_EVENT_SEQUENCE_DATA::ID),
35115 CURRENT_MODE_DATA::NAME => Some(CURRENT_MODE_DATA::ID),
35116 DATA_STREAM_DATA::NAME => Some(DATA_STREAM_DATA::ID),
35117 DATA_TRANSMISSION_HANDSHAKE_DATA::NAME => Some(DATA_TRANSMISSION_HANDSHAKE_DATA::ID),
35118 DEBUG_DATA::NAME => Some(DEBUG_DATA::ID),
35119 DEBUG_FLOAT_ARRAY_DATA::NAME => Some(DEBUG_FLOAT_ARRAY_DATA::ID),
35120 DEBUG_VECT_DATA::NAME => Some(DEBUG_VECT_DATA::ID),
35121 DISTANCE_SENSOR_DATA::NAME => Some(DISTANCE_SENSOR_DATA::ID),
35122 EFI_STATUS_DATA::NAME => Some(EFI_STATUS_DATA::ID),
35123 ENCAPSULATED_DATA_DATA::NAME => Some(ENCAPSULATED_DATA_DATA::ID),
35124 ESC_INFO_DATA::NAME => Some(ESC_INFO_DATA::ID),
35125 ESC_STATUS_DATA::NAME => Some(ESC_STATUS_DATA::ID),
35126 ESTIMATOR_STATUS_DATA::NAME => Some(ESTIMATOR_STATUS_DATA::ID),
35127 EVENT_DATA::NAME => Some(EVENT_DATA::ID),
35128 EXTENDED_SYS_STATE_DATA::NAME => Some(EXTENDED_SYS_STATE_DATA::ID),
35129 FENCE_STATUS_DATA::NAME => Some(FENCE_STATUS_DATA::ID),
35130 FILE_TRANSFER_PROTOCOL_DATA::NAME => Some(FILE_TRANSFER_PROTOCOL_DATA::ID),
35131 FLIGHT_INFORMATION_DATA::NAME => Some(FLIGHT_INFORMATION_DATA::ID),
35132 FOLLOW_TARGET_DATA::NAME => Some(FOLLOW_TARGET_DATA::ID),
35133 FUEL_STATUS_DATA::NAME => Some(FUEL_STATUS_DATA::ID),
35134 GENERATOR_STATUS_DATA::NAME => Some(GENERATOR_STATUS_DATA::ID),
35135 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME => {
35136 Some(GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID)
35137 }
35138 GIMBAL_DEVICE_INFORMATION_DATA::NAME => Some(GIMBAL_DEVICE_INFORMATION_DATA::ID),
35139 GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME => Some(GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID),
35140 GIMBAL_MANAGER_INFORMATION_DATA::NAME => Some(GIMBAL_MANAGER_INFORMATION_DATA::ID),
35141 GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME => Some(GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID),
35142 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME => {
35143 Some(GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID)
35144 }
35145 GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME => Some(GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID),
35146 GIMBAL_MANAGER_STATUS_DATA::NAME => Some(GIMBAL_MANAGER_STATUS_DATA::ID),
35147 GLOBAL_POSITION_INT_DATA::NAME => Some(GLOBAL_POSITION_INT_DATA::ID),
35148 GLOBAL_POSITION_INT_COV_DATA::NAME => Some(GLOBAL_POSITION_INT_COV_DATA::ID),
35149 GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME => {
35150 Some(GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID)
35151 }
35152 GPS2_RAW_DATA::NAME => Some(GPS2_RAW_DATA::ID),
35153 GPS2_RTK_DATA::NAME => Some(GPS2_RTK_DATA::ID),
35154 GPS_GLOBAL_ORIGIN_DATA::NAME => Some(GPS_GLOBAL_ORIGIN_DATA::ID),
35155 GPS_INJECT_DATA_DATA::NAME => Some(GPS_INJECT_DATA_DATA::ID),
35156 GPS_INPUT_DATA::NAME => Some(GPS_INPUT_DATA::ID),
35157 GPS_RAW_INT_DATA::NAME => Some(GPS_RAW_INT_DATA::ID),
35158 GPS_RTCM_DATA_DATA::NAME => Some(GPS_RTCM_DATA_DATA::ID),
35159 GPS_RTK_DATA::NAME => Some(GPS_RTK_DATA::ID),
35160 GPS_STATUS_DATA::NAME => Some(GPS_STATUS_DATA::ID),
35161 HEARTBEAT_DATA::NAME => Some(HEARTBEAT_DATA::ID),
35162 HIGHRES_IMU_DATA::NAME => Some(HIGHRES_IMU_DATA::ID),
35163 HIGH_LATENCY_DATA::NAME => Some(HIGH_LATENCY_DATA::ID),
35164 HIGH_LATENCY2_DATA::NAME => Some(HIGH_LATENCY2_DATA::ID),
35165 HIL_ACTUATOR_CONTROLS_DATA::NAME => Some(HIL_ACTUATOR_CONTROLS_DATA::ID),
35166 HIL_CONTROLS_DATA::NAME => Some(HIL_CONTROLS_DATA::ID),
35167 HIL_GPS_DATA::NAME => Some(HIL_GPS_DATA::ID),
35168 HIL_OPTICAL_FLOW_DATA::NAME => Some(HIL_OPTICAL_FLOW_DATA::ID),
35169 HIL_RC_INPUTS_RAW_DATA::NAME => Some(HIL_RC_INPUTS_RAW_DATA::ID),
35170 HIL_SENSOR_DATA::NAME => Some(HIL_SENSOR_DATA::ID),
35171 HIL_STATE_DATA::NAME => Some(HIL_STATE_DATA::ID),
35172 HIL_STATE_QUATERNION_DATA::NAME => Some(HIL_STATE_QUATERNION_DATA::ID),
35173 HOME_POSITION_DATA::NAME => Some(HOME_POSITION_DATA::ID),
35174 HYGROMETER_SENSOR_DATA::NAME => Some(HYGROMETER_SENSOR_DATA::ID),
35175 ILLUMINATOR_STATUS_DATA::NAME => Some(ILLUMINATOR_STATUS_DATA::ID),
35176 ISBD_LINK_STATUS_DATA::NAME => Some(ISBD_LINK_STATUS_DATA::ID),
35177 LANDING_TARGET_DATA::NAME => Some(LANDING_TARGET_DATA::ID),
35178 LINK_NODE_STATUS_DATA::NAME => Some(LINK_NODE_STATUS_DATA::ID),
35179 LOCAL_POSITION_NED_DATA::NAME => Some(LOCAL_POSITION_NED_DATA::ID),
35180 LOCAL_POSITION_NED_COV_DATA::NAME => Some(LOCAL_POSITION_NED_COV_DATA::ID),
35181 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME => {
35182 Some(LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID)
35183 }
35184 LOGGING_ACK_DATA::NAME => Some(LOGGING_ACK_DATA::ID),
35185 LOGGING_DATA_DATA::NAME => Some(LOGGING_DATA_DATA::ID),
35186 LOGGING_DATA_ACKED_DATA::NAME => Some(LOGGING_DATA_ACKED_DATA::ID),
35187 LOG_DATA_DATA::NAME => Some(LOG_DATA_DATA::ID),
35188 LOG_ENTRY_DATA::NAME => Some(LOG_ENTRY_DATA::ID),
35189 LOG_ERASE_DATA::NAME => Some(LOG_ERASE_DATA::ID),
35190 LOG_REQUEST_DATA_DATA::NAME => Some(LOG_REQUEST_DATA_DATA::ID),
35191 LOG_REQUEST_END_DATA::NAME => Some(LOG_REQUEST_END_DATA::ID),
35192 LOG_REQUEST_LIST_DATA::NAME => Some(LOG_REQUEST_LIST_DATA::ID),
35193 MAG_CAL_REPORT_DATA::NAME => Some(MAG_CAL_REPORT_DATA::ID),
35194 MANUAL_CONTROL_DATA::NAME => Some(MANUAL_CONTROL_DATA::ID),
35195 MANUAL_SETPOINT_DATA::NAME => Some(MANUAL_SETPOINT_DATA::ID),
35196 MEMORY_VECT_DATA::NAME => Some(MEMORY_VECT_DATA::ID),
35197 MESSAGE_INTERVAL_DATA::NAME => Some(MESSAGE_INTERVAL_DATA::ID),
35198 MISSION_ACK_DATA::NAME => Some(MISSION_ACK_DATA::ID),
35199 MISSION_CLEAR_ALL_DATA::NAME => Some(MISSION_CLEAR_ALL_DATA::ID),
35200 MISSION_COUNT_DATA::NAME => Some(MISSION_COUNT_DATA::ID),
35201 MISSION_CURRENT_DATA::NAME => Some(MISSION_CURRENT_DATA::ID),
35202 MISSION_ITEM_DATA::NAME => Some(MISSION_ITEM_DATA::ID),
35203 MISSION_ITEM_INT_DATA::NAME => Some(MISSION_ITEM_INT_DATA::ID),
35204 MISSION_ITEM_REACHED_DATA::NAME => Some(MISSION_ITEM_REACHED_DATA::ID),
35205 MISSION_REQUEST_DATA::NAME => Some(MISSION_REQUEST_DATA::ID),
35206 MISSION_REQUEST_INT_DATA::NAME => Some(MISSION_REQUEST_INT_DATA::ID),
35207 MISSION_REQUEST_LIST_DATA::NAME => Some(MISSION_REQUEST_LIST_DATA::ID),
35208 MISSION_REQUEST_PARTIAL_LIST_DATA::NAME => Some(MISSION_REQUEST_PARTIAL_LIST_DATA::ID),
35209 MISSION_SET_CURRENT_DATA::NAME => Some(MISSION_SET_CURRENT_DATA::ID),
35210 MISSION_WRITE_PARTIAL_LIST_DATA::NAME => Some(MISSION_WRITE_PARTIAL_LIST_DATA::ID),
35211 MOUNT_ORIENTATION_DATA::NAME => Some(MOUNT_ORIENTATION_DATA::ID),
35212 NAMED_VALUE_FLOAT_DATA::NAME => Some(NAMED_VALUE_FLOAT_DATA::ID),
35213 NAMED_VALUE_INT_DATA::NAME => Some(NAMED_VALUE_INT_DATA::ID),
35214 NAV_CONTROLLER_OUTPUT_DATA::NAME => Some(NAV_CONTROLLER_OUTPUT_DATA::ID),
35215 OBSTACLE_DISTANCE_DATA::NAME => Some(OBSTACLE_DISTANCE_DATA::ID),
35216 ODOMETRY_DATA::NAME => Some(ODOMETRY_DATA::ID),
35217 ONBOARD_COMPUTER_STATUS_DATA::NAME => Some(ONBOARD_COMPUTER_STATUS_DATA::ID),
35218 OPEN_DRONE_ID_ARM_STATUS_DATA::NAME => Some(OPEN_DRONE_ID_ARM_STATUS_DATA::ID),
35219 OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME => Some(OPEN_DRONE_ID_AUTHENTICATION_DATA::ID),
35220 OPEN_DRONE_ID_BASIC_ID_DATA::NAME => Some(OPEN_DRONE_ID_BASIC_ID_DATA::ID),
35221 OPEN_DRONE_ID_LOCATION_DATA::NAME => Some(OPEN_DRONE_ID_LOCATION_DATA::ID),
35222 OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME => Some(OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID),
35223 OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME => Some(OPEN_DRONE_ID_OPERATOR_ID_DATA::ID),
35224 OPEN_DRONE_ID_SELF_ID_DATA::NAME => Some(OPEN_DRONE_ID_SELF_ID_DATA::ID),
35225 OPEN_DRONE_ID_SYSTEM_DATA::NAME => Some(OPEN_DRONE_ID_SYSTEM_DATA::ID),
35226 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME => Some(OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID),
35227 OPTICAL_FLOW_DATA::NAME => Some(OPTICAL_FLOW_DATA::ID),
35228 OPTICAL_FLOW_RAD_DATA::NAME => Some(OPTICAL_FLOW_RAD_DATA::ID),
35229 ORBIT_EXECUTION_STATUS_DATA::NAME => Some(ORBIT_EXECUTION_STATUS_DATA::ID),
35230 PARAM_EXT_ACK_DATA::NAME => Some(PARAM_EXT_ACK_DATA::ID),
35231 PARAM_EXT_REQUEST_LIST_DATA::NAME => Some(PARAM_EXT_REQUEST_LIST_DATA::ID),
35232 PARAM_EXT_REQUEST_READ_DATA::NAME => Some(PARAM_EXT_REQUEST_READ_DATA::ID),
35233 PARAM_EXT_SET_DATA::NAME => Some(PARAM_EXT_SET_DATA::ID),
35234 PARAM_EXT_VALUE_DATA::NAME => Some(PARAM_EXT_VALUE_DATA::ID),
35235 PARAM_MAP_RC_DATA::NAME => Some(PARAM_MAP_RC_DATA::ID),
35236 PARAM_REQUEST_LIST_DATA::NAME => Some(PARAM_REQUEST_LIST_DATA::ID),
35237 PARAM_REQUEST_READ_DATA::NAME => Some(PARAM_REQUEST_READ_DATA::ID),
35238 PARAM_SET_DATA::NAME => Some(PARAM_SET_DATA::ID),
35239 PARAM_VALUE_DATA::NAME => Some(PARAM_VALUE_DATA::ID),
35240 PING_DATA::NAME => Some(PING_DATA::ID),
35241 PLAY_TUNE_DATA::NAME => Some(PLAY_TUNE_DATA::ID),
35242 PLAY_TUNE_V2_DATA::NAME => Some(PLAY_TUNE_V2_DATA::ID),
35243 POSITION_TARGET_GLOBAL_INT_DATA::NAME => Some(POSITION_TARGET_GLOBAL_INT_DATA::ID),
35244 POSITION_TARGET_LOCAL_NED_DATA::NAME => Some(POSITION_TARGET_LOCAL_NED_DATA::ID),
35245 POWER_STATUS_DATA::NAME => Some(POWER_STATUS_DATA::ID),
35246 PROTOCOL_VERSION_DATA::NAME => Some(PROTOCOL_VERSION_DATA::ID),
35247 RADIO_STATUS_DATA::NAME => Some(RADIO_STATUS_DATA::ID),
35248 RAW_IMU_DATA::NAME => Some(RAW_IMU_DATA::ID),
35249 RAW_PRESSURE_DATA::NAME => Some(RAW_PRESSURE_DATA::ID),
35250 RAW_RPM_DATA::NAME => Some(RAW_RPM_DATA::ID),
35251 RC_CHANNELS_DATA::NAME => Some(RC_CHANNELS_DATA::ID),
35252 RC_CHANNELS_OVERRIDE_DATA::NAME => Some(RC_CHANNELS_OVERRIDE_DATA::ID),
35253 RC_CHANNELS_RAW_DATA::NAME => Some(RC_CHANNELS_RAW_DATA::ID),
35254 RC_CHANNELS_SCALED_DATA::NAME => Some(RC_CHANNELS_SCALED_DATA::ID),
35255 REQUEST_DATA_STREAM_DATA::NAME => Some(REQUEST_DATA_STREAM_DATA::ID),
35256 REQUEST_EVENT_DATA::NAME => Some(REQUEST_EVENT_DATA::ID),
35257 RESOURCE_REQUEST_DATA::NAME => Some(RESOURCE_REQUEST_DATA::ID),
35258 RESPONSE_EVENT_ERROR_DATA::NAME => Some(RESPONSE_EVENT_ERROR_DATA::ID),
35259 SAFETY_ALLOWED_AREA_DATA::NAME => Some(SAFETY_ALLOWED_AREA_DATA::ID),
35260 SAFETY_SET_ALLOWED_AREA_DATA::NAME => Some(SAFETY_SET_ALLOWED_AREA_DATA::ID),
35261 SCALED_IMU_DATA::NAME => Some(SCALED_IMU_DATA::ID),
35262 SCALED_IMU2_DATA::NAME => Some(SCALED_IMU2_DATA::ID),
35263 SCALED_IMU3_DATA::NAME => Some(SCALED_IMU3_DATA::ID),
35264 SCALED_PRESSURE_DATA::NAME => Some(SCALED_PRESSURE_DATA::ID),
35265 SCALED_PRESSURE2_DATA::NAME => Some(SCALED_PRESSURE2_DATA::ID),
35266 SCALED_PRESSURE3_DATA::NAME => Some(SCALED_PRESSURE3_DATA::ID),
35267 SERIAL_CONTROL_DATA::NAME => Some(SERIAL_CONTROL_DATA::ID),
35268 SERVO_OUTPUT_RAW_DATA::NAME => Some(SERVO_OUTPUT_RAW_DATA::ID),
35269 SETUP_SIGNING_DATA::NAME => Some(SETUP_SIGNING_DATA::ID),
35270 SET_ACTUATOR_CONTROL_TARGET_DATA::NAME => Some(SET_ACTUATOR_CONTROL_TARGET_DATA::ID),
35271 SET_ATTITUDE_TARGET_DATA::NAME => Some(SET_ATTITUDE_TARGET_DATA::ID),
35272 SET_GPS_GLOBAL_ORIGIN_DATA::NAME => Some(SET_GPS_GLOBAL_ORIGIN_DATA::ID),
35273 SET_HOME_POSITION_DATA::NAME => Some(SET_HOME_POSITION_DATA::ID),
35274 SET_MODE_DATA::NAME => Some(SET_MODE_DATA::ID),
35275 SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME => {
35276 Some(SET_POSITION_TARGET_GLOBAL_INT_DATA::ID)
35277 }
35278 SET_POSITION_TARGET_LOCAL_NED_DATA::NAME => {
35279 Some(SET_POSITION_TARGET_LOCAL_NED_DATA::ID)
35280 }
35281 SIM_STATE_DATA::NAME => Some(SIM_STATE_DATA::ID),
35282 SMART_BATTERY_INFO_DATA::NAME => Some(SMART_BATTERY_INFO_DATA::ID),
35283 STATUSTEXT_DATA::NAME => Some(STATUSTEXT_DATA::ID),
35284 STORAGE_INFORMATION_DATA::NAME => Some(STORAGE_INFORMATION_DATA::ID),
35285 SUPPORTED_TUNES_DATA::NAME => Some(SUPPORTED_TUNES_DATA::ID),
35286 SYSTEM_TIME_DATA::NAME => Some(SYSTEM_TIME_DATA::ID),
35287 SYS_STATUS_DATA::NAME => Some(SYS_STATUS_DATA::ID),
35288 TERRAIN_CHECK_DATA::NAME => Some(TERRAIN_CHECK_DATA::ID),
35289 TERRAIN_DATA_DATA::NAME => Some(TERRAIN_DATA_DATA::ID),
35290 TERRAIN_REPORT_DATA::NAME => Some(TERRAIN_REPORT_DATA::ID),
35291 TERRAIN_REQUEST_DATA::NAME => Some(TERRAIN_REQUEST_DATA::ID),
35292 TIMESYNC_DATA::NAME => Some(TIMESYNC_DATA::ID),
35293 TIME_ESTIMATE_TO_TARGET_DATA::NAME => Some(TIME_ESTIMATE_TO_TARGET_DATA::ID),
35294 TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME => {
35295 Some(TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID)
35296 }
35297 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME => {
35298 Some(TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID)
35299 }
35300 TUNNEL_DATA::NAME => Some(TUNNEL_DATA::ID),
35301 UAVCAN_NODE_INFO_DATA::NAME => Some(UAVCAN_NODE_INFO_DATA::ID),
35302 UAVCAN_NODE_STATUS_DATA::NAME => Some(UAVCAN_NODE_STATUS_DATA::ID),
35303 UTM_GLOBAL_POSITION_DATA::NAME => Some(UTM_GLOBAL_POSITION_DATA::ID),
35304 V2_EXTENSION_DATA::NAME => Some(V2_EXTENSION_DATA::ID),
35305 VFR_HUD_DATA::NAME => Some(VFR_HUD_DATA::ID),
35306 VIBRATION_DATA::NAME => Some(VIBRATION_DATA::ID),
35307 VICON_POSITION_ESTIMATE_DATA::NAME => Some(VICON_POSITION_ESTIMATE_DATA::ID),
35308 VIDEO_STREAM_INFORMATION_DATA::NAME => Some(VIDEO_STREAM_INFORMATION_DATA::ID),
35309 VIDEO_STREAM_STATUS_DATA::NAME => Some(VIDEO_STREAM_STATUS_DATA::ID),
35310 VISION_POSITION_ESTIMATE_DATA::NAME => Some(VISION_POSITION_ESTIMATE_DATA::ID),
35311 VISION_SPEED_ESTIMATE_DATA::NAME => Some(VISION_SPEED_ESTIMATE_DATA::ID),
35312 WHEEL_DISTANCE_DATA::NAME => Some(WHEEL_DISTANCE_DATA::ID),
35313 WIFI_CONFIG_AP_DATA::NAME => Some(WIFI_CONFIG_AP_DATA::ID),
35314 WINCH_STATUS_DATA::NAME => Some(WINCH_STATUS_DATA::ID),
35315 WIND_COV_DATA::NAME => Some(WIND_COV_DATA::ID),
35316 _ => None,
35317 }
35318 }
35319 fn default_message_from_id(id: u32) -> Option<Self> {
35320 match id {
35321 ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::ACTUATOR_CONTROL_TARGET(
35322 ACTUATOR_CONTROL_TARGET_DATA::default(),
35323 )),
35324 ACTUATOR_OUTPUT_STATUS_DATA::ID => Some(Self::ACTUATOR_OUTPUT_STATUS(
35325 ACTUATOR_OUTPUT_STATUS_DATA::default(),
35326 )),
35327 ADSB_VEHICLE_DATA::ID => Some(Self::ADSB_VEHICLE(ADSB_VEHICLE_DATA::default())),
35328 AIS_VESSEL_DATA::ID => Some(Self::AIS_VESSEL(AIS_VESSEL_DATA::default())),
35329 ALTITUDE_DATA::ID => Some(Self::ALTITUDE(ALTITUDE_DATA::default())),
35330 ATTITUDE_DATA::ID => Some(Self::ATTITUDE(ATTITUDE_DATA::default())),
35331 ATTITUDE_QUATERNION_DATA::ID => Some(Self::ATTITUDE_QUATERNION(
35332 ATTITUDE_QUATERNION_DATA::default(),
35333 )),
35334 ATTITUDE_QUATERNION_COV_DATA::ID => Some(Self::ATTITUDE_QUATERNION_COV(
35335 ATTITUDE_QUATERNION_COV_DATA::default(),
35336 )),
35337 ATTITUDE_TARGET_DATA::ID => {
35338 Some(Self::ATTITUDE_TARGET(ATTITUDE_TARGET_DATA::default()))
35339 }
35340 ATT_POS_MOCAP_DATA::ID => Some(Self::ATT_POS_MOCAP(ATT_POS_MOCAP_DATA::default())),
35341 AUTH_KEY_DATA::ID => Some(Self::AUTH_KEY(AUTH_KEY_DATA::default())),
35342 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
35343 Some(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(
35344 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::default(),
35345 ))
35346 }
35347 AUTOPILOT_VERSION_DATA::ID => {
35348 Some(Self::AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA::default()))
35349 }
35350 AVAILABLE_MODES_DATA::ID => {
35351 Some(Self::AVAILABLE_MODES(AVAILABLE_MODES_DATA::default()))
35352 }
35353 AVAILABLE_MODES_MONITOR_DATA::ID => Some(Self::AVAILABLE_MODES_MONITOR(
35354 AVAILABLE_MODES_MONITOR_DATA::default(),
35355 )),
35356 AVSS_DRONE_IMU_DATA::ID => Some(Self::AVSS_DRONE_IMU(AVSS_DRONE_IMU_DATA::default())),
35357 AVSS_DRONE_OPERATION_MODE_DATA::ID => Some(Self::AVSS_DRONE_OPERATION_MODE(
35358 AVSS_DRONE_OPERATION_MODE_DATA::default(),
35359 )),
35360 AVSS_DRONE_POSITION_DATA::ID => Some(Self::AVSS_DRONE_POSITION(
35361 AVSS_DRONE_POSITION_DATA::default(),
35362 )),
35363 AVSS_PRS_SYS_STATUS_DATA::ID => Some(Self::AVSS_PRS_SYS_STATUS(
35364 AVSS_PRS_SYS_STATUS_DATA::default(),
35365 )),
35366 BATTERY_INFO_DATA::ID => Some(Self::BATTERY_INFO(BATTERY_INFO_DATA::default())),
35367 BATTERY_STATUS_DATA::ID => Some(Self::BATTERY_STATUS(BATTERY_STATUS_DATA::default())),
35368 BUTTON_CHANGE_DATA::ID => Some(Self::BUTTON_CHANGE(BUTTON_CHANGE_DATA::default())),
35369 CAMERA_CAPTURE_STATUS_DATA::ID => Some(Self::CAMERA_CAPTURE_STATUS(
35370 CAMERA_CAPTURE_STATUS_DATA::default(),
35371 )),
35372 CAMERA_FOV_STATUS_DATA::ID => {
35373 Some(Self::CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA::default()))
35374 }
35375 CAMERA_IMAGE_CAPTURED_DATA::ID => Some(Self::CAMERA_IMAGE_CAPTURED(
35376 CAMERA_IMAGE_CAPTURED_DATA::default(),
35377 )),
35378 CAMERA_INFORMATION_DATA::ID => {
35379 Some(Self::CAMERA_INFORMATION(CAMERA_INFORMATION_DATA::default()))
35380 }
35381 CAMERA_SETTINGS_DATA::ID => {
35382 Some(Self::CAMERA_SETTINGS(CAMERA_SETTINGS_DATA::default()))
35383 }
35384 CAMERA_THERMAL_RANGE_DATA::ID => Some(Self::CAMERA_THERMAL_RANGE(
35385 CAMERA_THERMAL_RANGE_DATA::default(),
35386 )),
35387 CAMERA_TRACKING_GEO_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_GEO_STATUS(
35388 CAMERA_TRACKING_GEO_STATUS_DATA::default(),
35389 )),
35390 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_IMAGE_STATUS(
35391 CAMERA_TRACKING_IMAGE_STATUS_DATA::default(),
35392 )),
35393 CAMERA_TRIGGER_DATA::ID => Some(Self::CAMERA_TRIGGER(CAMERA_TRIGGER_DATA::default())),
35394 CANFD_FRAME_DATA::ID => Some(Self::CANFD_FRAME(CANFD_FRAME_DATA::default())),
35395 CAN_FILTER_MODIFY_DATA::ID => {
35396 Some(Self::CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA::default()))
35397 }
35398 CAN_FRAME_DATA::ID => Some(Self::CAN_FRAME(CAN_FRAME_DATA::default())),
35399 CELLULAR_CONFIG_DATA::ID => {
35400 Some(Self::CELLULAR_CONFIG(CELLULAR_CONFIG_DATA::default()))
35401 }
35402 CELLULAR_STATUS_DATA::ID => {
35403 Some(Self::CELLULAR_STATUS(CELLULAR_STATUS_DATA::default()))
35404 }
35405 CHANGE_OPERATOR_CONTROL_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL(
35406 CHANGE_OPERATOR_CONTROL_DATA::default(),
35407 )),
35408 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL_ACK(
35409 CHANGE_OPERATOR_CONTROL_ACK_DATA::default(),
35410 )),
35411 COLLISION_DATA::ID => Some(Self::COLLISION(COLLISION_DATA::default())),
35412 COMMAND_ACK_DATA::ID => Some(Self::COMMAND_ACK(COMMAND_ACK_DATA::default())),
35413 COMMAND_CANCEL_DATA::ID => Some(Self::COMMAND_CANCEL(COMMAND_CANCEL_DATA::default())),
35414 COMMAND_INT_DATA::ID => Some(Self::COMMAND_INT(COMMAND_INT_DATA::default())),
35415 COMMAND_LONG_DATA::ID => Some(Self::COMMAND_LONG(COMMAND_LONG_DATA::default())),
35416 COMPONENT_INFORMATION_DATA::ID => Some(Self::COMPONENT_INFORMATION(
35417 COMPONENT_INFORMATION_DATA::default(),
35418 )),
35419 COMPONENT_INFORMATION_BASIC_DATA::ID => Some(Self::COMPONENT_INFORMATION_BASIC(
35420 COMPONENT_INFORMATION_BASIC_DATA::default(),
35421 )),
35422 COMPONENT_METADATA_DATA::ID => {
35423 Some(Self::COMPONENT_METADATA(COMPONENT_METADATA_DATA::default()))
35424 }
35425 CONTROL_SYSTEM_STATE_DATA::ID => Some(Self::CONTROL_SYSTEM_STATE(
35426 CONTROL_SYSTEM_STATE_DATA::default(),
35427 )),
35428 CURRENT_EVENT_SEQUENCE_DATA::ID => Some(Self::CURRENT_EVENT_SEQUENCE(
35429 CURRENT_EVENT_SEQUENCE_DATA::default(),
35430 )),
35431 CURRENT_MODE_DATA::ID => Some(Self::CURRENT_MODE(CURRENT_MODE_DATA::default())),
35432 DATA_STREAM_DATA::ID => Some(Self::DATA_STREAM(DATA_STREAM_DATA::default())),
35433 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => Some(Self::DATA_TRANSMISSION_HANDSHAKE(
35434 DATA_TRANSMISSION_HANDSHAKE_DATA::default(),
35435 )),
35436 DEBUG_DATA::ID => Some(Self::DEBUG(DEBUG_DATA::default())),
35437 DEBUG_FLOAT_ARRAY_DATA::ID => {
35438 Some(Self::DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA::default()))
35439 }
35440 DEBUG_VECT_DATA::ID => Some(Self::DEBUG_VECT(DEBUG_VECT_DATA::default())),
35441 DISTANCE_SENSOR_DATA::ID => {
35442 Some(Self::DISTANCE_SENSOR(DISTANCE_SENSOR_DATA::default()))
35443 }
35444 EFI_STATUS_DATA::ID => Some(Self::EFI_STATUS(EFI_STATUS_DATA::default())),
35445 ENCAPSULATED_DATA_DATA::ID => {
35446 Some(Self::ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA::default()))
35447 }
35448 ESC_INFO_DATA::ID => Some(Self::ESC_INFO(ESC_INFO_DATA::default())),
35449 ESC_STATUS_DATA::ID => Some(Self::ESC_STATUS(ESC_STATUS_DATA::default())),
35450 ESTIMATOR_STATUS_DATA::ID => {
35451 Some(Self::ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA::default()))
35452 }
35453 EVENT_DATA::ID => Some(Self::EVENT(EVENT_DATA::default())),
35454 EXTENDED_SYS_STATE_DATA::ID => {
35455 Some(Self::EXTENDED_SYS_STATE(EXTENDED_SYS_STATE_DATA::default()))
35456 }
35457 FENCE_STATUS_DATA::ID => Some(Self::FENCE_STATUS(FENCE_STATUS_DATA::default())),
35458 FILE_TRANSFER_PROTOCOL_DATA::ID => Some(Self::FILE_TRANSFER_PROTOCOL(
35459 FILE_TRANSFER_PROTOCOL_DATA::default(),
35460 )),
35461 FLIGHT_INFORMATION_DATA::ID => {
35462 Some(Self::FLIGHT_INFORMATION(FLIGHT_INFORMATION_DATA::default()))
35463 }
35464 FOLLOW_TARGET_DATA::ID => Some(Self::FOLLOW_TARGET(FOLLOW_TARGET_DATA::default())),
35465 FUEL_STATUS_DATA::ID => Some(Self::FUEL_STATUS(FUEL_STATUS_DATA::default())),
35466 GENERATOR_STATUS_DATA::ID => {
35467 Some(Self::GENERATOR_STATUS(GENERATOR_STATUS_DATA::default()))
35468 }
35469 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => Some(Self::GIMBAL_DEVICE_ATTITUDE_STATUS(
35470 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::default(),
35471 )),
35472 GIMBAL_DEVICE_INFORMATION_DATA::ID => Some(Self::GIMBAL_DEVICE_INFORMATION(
35473 GIMBAL_DEVICE_INFORMATION_DATA::default(),
35474 )),
35475 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_DEVICE_SET_ATTITUDE(
35476 GIMBAL_DEVICE_SET_ATTITUDE_DATA::default(),
35477 )),
35478 GIMBAL_MANAGER_INFORMATION_DATA::ID => Some(Self::GIMBAL_MANAGER_INFORMATION(
35479 GIMBAL_MANAGER_INFORMATION_DATA::default(),
35480 )),
35481 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_ATTITUDE(
35482 GIMBAL_MANAGER_SET_ATTITUDE_DATA::default(),
35483 )),
35484 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
35485 Some(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(
35486 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::default(),
35487 ))
35488 }
35489 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_PITCHYAW(
35490 GIMBAL_MANAGER_SET_PITCHYAW_DATA::default(),
35491 )),
35492 GIMBAL_MANAGER_STATUS_DATA::ID => Some(Self::GIMBAL_MANAGER_STATUS(
35493 GIMBAL_MANAGER_STATUS_DATA::default(),
35494 )),
35495 GLOBAL_POSITION_INT_DATA::ID => Some(Self::GLOBAL_POSITION_INT(
35496 GLOBAL_POSITION_INT_DATA::default(),
35497 )),
35498 GLOBAL_POSITION_INT_COV_DATA::ID => Some(Self::GLOBAL_POSITION_INT_COV(
35499 GLOBAL_POSITION_INT_COV_DATA::default(),
35500 )),
35501 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
35502 Some(Self::GLOBAL_VISION_POSITION_ESTIMATE(
35503 GLOBAL_VISION_POSITION_ESTIMATE_DATA::default(),
35504 ))
35505 }
35506 GPS2_RAW_DATA::ID => Some(Self::GPS2_RAW(GPS2_RAW_DATA::default())),
35507 GPS2_RTK_DATA::ID => Some(Self::GPS2_RTK(GPS2_RTK_DATA::default())),
35508 GPS_GLOBAL_ORIGIN_DATA::ID => {
35509 Some(Self::GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA::default()))
35510 }
35511 GPS_INJECT_DATA_DATA::ID => {
35512 Some(Self::GPS_INJECT_DATA(GPS_INJECT_DATA_DATA::default()))
35513 }
35514 GPS_INPUT_DATA::ID => Some(Self::GPS_INPUT(GPS_INPUT_DATA::default())),
35515 GPS_RAW_INT_DATA::ID => Some(Self::GPS_RAW_INT(GPS_RAW_INT_DATA::default())),
35516 GPS_RTCM_DATA_DATA::ID => Some(Self::GPS_RTCM_DATA(GPS_RTCM_DATA_DATA::default())),
35517 GPS_RTK_DATA::ID => Some(Self::GPS_RTK(GPS_RTK_DATA::default())),
35518 GPS_STATUS_DATA::ID => Some(Self::GPS_STATUS(GPS_STATUS_DATA::default())),
35519 HEARTBEAT_DATA::ID => Some(Self::HEARTBEAT(HEARTBEAT_DATA::default())),
35520 HIGHRES_IMU_DATA::ID => Some(Self::HIGHRES_IMU(HIGHRES_IMU_DATA::default())),
35521 HIGH_LATENCY_DATA::ID => Some(Self::HIGH_LATENCY(HIGH_LATENCY_DATA::default())),
35522 HIGH_LATENCY2_DATA::ID => Some(Self::HIGH_LATENCY2(HIGH_LATENCY2_DATA::default())),
35523 HIL_ACTUATOR_CONTROLS_DATA::ID => Some(Self::HIL_ACTUATOR_CONTROLS(
35524 HIL_ACTUATOR_CONTROLS_DATA::default(),
35525 )),
35526 HIL_CONTROLS_DATA::ID => Some(Self::HIL_CONTROLS(HIL_CONTROLS_DATA::default())),
35527 HIL_GPS_DATA::ID => Some(Self::HIL_GPS(HIL_GPS_DATA::default())),
35528 HIL_OPTICAL_FLOW_DATA::ID => {
35529 Some(Self::HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA::default()))
35530 }
35531 HIL_RC_INPUTS_RAW_DATA::ID => {
35532 Some(Self::HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA::default()))
35533 }
35534 HIL_SENSOR_DATA::ID => Some(Self::HIL_SENSOR(HIL_SENSOR_DATA::default())),
35535 HIL_STATE_DATA::ID => Some(Self::HIL_STATE(HIL_STATE_DATA::default())),
35536 HIL_STATE_QUATERNION_DATA::ID => Some(Self::HIL_STATE_QUATERNION(
35537 HIL_STATE_QUATERNION_DATA::default(),
35538 )),
35539 HOME_POSITION_DATA::ID => Some(Self::HOME_POSITION(HOME_POSITION_DATA::default())),
35540 HYGROMETER_SENSOR_DATA::ID => {
35541 Some(Self::HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA::default()))
35542 }
35543 ILLUMINATOR_STATUS_DATA::ID => {
35544 Some(Self::ILLUMINATOR_STATUS(ILLUMINATOR_STATUS_DATA::default()))
35545 }
35546 ISBD_LINK_STATUS_DATA::ID => {
35547 Some(Self::ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA::default()))
35548 }
35549 LANDING_TARGET_DATA::ID => Some(Self::LANDING_TARGET(LANDING_TARGET_DATA::default())),
35550 LINK_NODE_STATUS_DATA::ID => {
35551 Some(Self::LINK_NODE_STATUS(LINK_NODE_STATUS_DATA::default()))
35552 }
35553 LOCAL_POSITION_NED_DATA::ID => {
35554 Some(Self::LOCAL_POSITION_NED(LOCAL_POSITION_NED_DATA::default()))
35555 }
35556 LOCAL_POSITION_NED_COV_DATA::ID => Some(Self::LOCAL_POSITION_NED_COV(
35557 LOCAL_POSITION_NED_COV_DATA::default(),
35558 )),
35559 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
35560 Some(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(
35561 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::default(),
35562 ))
35563 }
35564 LOGGING_ACK_DATA::ID => Some(Self::LOGGING_ACK(LOGGING_ACK_DATA::default())),
35565 LOGGING_DATA_DATA::ID => Some(Self::LOGGING_DATA(LOGGING_DATA_DATA::default())),
35566 LOGGING_DATA_ACKED_DATA::ID => {
35567 Some(Self::LOGGING_DATA_ACKED(LOGGING_DATA_ACKED_DATA::default()))
35568 }
35569 LOG_DATA_DATA::ID => Some(Self::LOG_DATA(LOG_DATA_DATA::default())),
35570 LOG_ENTRY_DATA::ID => Some(Self::LOG_ENTRY(LOG_ENTRY_DATA::default())),
35571 LOG_ERASE_DATA::ID => Some(Self::LOG_ERASE(LOG_ERASE_DATA::default())),
35572 LOG_REQUEST_DATA_DATA::ID => {
35573 Some(Self::LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA::default()))
35574 }
35575 LOG_REQUEST_END_DATA::ID => {
35576 Some(Self::LOG_REQUEST_END(LOG_REQUEST_END_DATA::default()))
35577 }
35578 LOG_REQUEST_LIST_DATA::ID => {
35579 Some(Self::LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA::default()))
35580 }
35581 MAG_CAL_REPORT_DATA::ID => Some(Self::MAG_CAL_REPORT(MAG_CAL_REPORT_DATA::default())),
35582 MANUAL_CONTROL_DATA::ID => Some(Self::MANUAL_CONTROL(MANUAL_CONTROL_DATA::default())),
35583 MANUAL_SETPOINT_DATA::ID => {
35584 Some(Self::MANUAL_SETPOINT(MANUAL_SETPOINT_DATA::default()))
35585 }
35586 MEMORY_VECT_DATA::ID => Some(Self::MEMORY_VECT(MEMORY_VECT_DATA::default())),
35587 MESSAGE_INTERVAL_DATA::ID => {
35588 Some(Self::MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA::default()))
35589 }
35590 MISSION_ACK_DATA::ID => Some(Self::MISSION_ACK(MISSION_ACK_DATA::default())),
35591 MISSION_CLEAR_ALL_DATA::ID => {
35592 Some(Self::MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA::default()))
35593 }
35594 MISSION_COUNT_DATA::ID => Some(Self::MISSION_COUNT(MISSION_COUNT_DATA::default())),
35595 MISSION_CURRENT_DATA::ID => {
35596 Some(Self::MISSION_CURRENT(MISSION_CURRENT_DATA::default()))
35597 }
35598 MISSION_ITEM_DATA::ID => Some(Self::MISSION_ITEM(MISSION_ITEM_DATA::default())),
35599 MISSION_ITEM_INT_DATA::ID => {
35600 Some(Self::MISSION_ITEM_INT(MISSION_ITEM_INT_DATA::default()))
35601 }
35602 MISSION_ITEM_REACHED_DATA::ID => Some(Self::MISSION_ITEM_REACHED(
35603 MISSION_ITEM_REACHED_DATA::default(),
35604 )),
35605 MISSION_REQUEST_DATA::ID => {
35606 Some(Self::MISSION_REQUEST(MISSION_REQUEST_DATA::default()))
35607 }
35608 MISSION_REQUEST_INT_DATA::ID => Some(Self::MISSION_REQUEST_INT(
35609 MISSION_REQUEST_INT_DATA::default(),
35610 )),
35611 MISSION_REQUEST_LIST_DATA::ID => Some(Self::MISSION_REQUEST_LIST(
35612 MISSION_REQUEST_LIST_DATA::default(),
35613 )),
35614 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_REQUEST_PARTIAL_LIST(
35615 MISSION_REQUEST_PARTIAL_LIST_DATA::default(),
35616 )),
35617 MISSION_SET_CURRENT_DATA::ID => Some(Self::MISSION_SET_CURRENT(
35618 MISSION_SET_CURRENT_DATA::default(),
35619 )),
35620 MISSION_WRITE_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_WRITE_PARTIAL_LIST(
35621 MISSION_WRITE_PARTIAL_LIST_DATA::default(),
35622 )),
35623 MOUNT_ORIENTATION_DATA::ID => {
35624 Some(Self::MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA::default()))
35625 }
35626 NAMED_VALUE_FLOAT_DATA::ID => {
35627 Some(Self::NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA::default()))
35628 }
35629 NAMED_VALUE_INT_DATA::ID => {
35630 Some(Self::NAMED_VALUE_INT(NAMED_VALUE_INT_DATA::default()))
35631 }
35632 NAV_CONTROLLER_OUTPUT_DATA::ID => Some(Self::NAV_CONTROLLER_OUTPUT(
35633 NAV_CONTROLLER_OUTPUT_DATA::default(),
35634 )),
35635 OBSTACLE_DISTANCE_DATA::ID => {
35636 Some(Self::OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA::default()))
35637 }
35638 ODOMETRY_DATA::ID => Some(Self::ODOMETRY(ODOMETRY_DATA::default())),
35639 ONBOARD_COMPUTER_STATUS_DATA::ID => Some(Self::ONBOARD_COMPUTER_STATUS(
35640 ONBOARD_COMPUTER_STATUS_DATA::default(),
35641 )),
35642 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => Some(Self::OPEN_DRONE_ID_ARM_STATUS(
35643 OPEN_DRONE_ID_ARM_STATUS_DATA::default(),
35644 )),
35645 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => Some(Self::OPEN_DRONE_ID_AUTHENTICATION(
35646 OPEN_DRONE_ID_AUTHENTICATION_DATA::default(),
35647 )),
35648 OPEN_DRONE_ID_BASIC_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_BASIC_ID(
35649 OPEN_DRONE_ID_BASIC_ID_DATA::default(),
35650 )),
35651 OPEN_DRONE_ID_LOCATION_DATA::ID => Some(Self::OPEN_DRONE_ID_LOCATION(
35652 OPEN_DRONE_ID_LOCATION_DATA::default(),
35653 )),
35654 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => Some(Self::OPEN_DRONE_ID_MESSAGE_PACK(
35655 OPEN_DRONE_ID_MESSAGE_PACK_DATA::default(),
35656 )),
35657 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_OPERATOR_ID(
35658 OPEN_DRONE_ID_OPERATOR_ID_DATA::default(),
35659 )),
35660 OPEN_DRONE_ID_SELF_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_SELF_ID(
35661 OPEN_DRONE_ID_SELF_ID_DATA::default(),
35662 )),
35663 OPEN_DRONE_ID_SYSTEM_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM(
35664 OPEN_DRONE_ID_SYSTEM_DATA::default(),
35665 )),
35666 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM_UPDATE(
35667 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::default(),
35668 )),
35669 OPTICAL_FLOW_DATA::ID => Some(Self::OPTICAL_FLOW(OPTICAL_FLOW_DATA::default())),
35670 OPTICAL_FLOW_RAD_DATA::ID => {
35671 Some(Self::OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA::default()))
35672 }
35673 ORBIT_EXECUTION_STATUS_DATA::ID => Some(Self::ORBIT_EXECUTION_STATUS(
35674 ORBIT_EXECUTION_STATUS_DATA::default(),
35675 )),
35676 PARAM_EXT_ACK_DATA::ID => Some(Self::PARAM_EXT_ACK(PARAM_EXT_ACK_DATA::default())),
35677 PARAM_EXT_REQUEST_LIST_DATA::ID => Some(Self::PARAM_EXT_REQUEST_LIST(
35678 PARAM_EXT_REQUEST_LIST_DATA::default(),
35679 )),
35680 PARAM_EXT_REQUEST_READ_DATA::ID => Some(Self::PARAM_EXT_REQUEST_READ(
35681 PARAM_EXT_REQUEST_READ_DATA::default(),
35682 )),
35683 PARAM_EXT_SET_DATA::ID => Some(Self::PARAM_EXT_SET(PARAM_EXT_SET_DATA::default())),
35684 PARAM_EXT_VALUE_DATA::ID => {
35685 Some(Self::PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA::default()))
35686 }
35687 PARAM_MAP_RC_DATA::ID => Some(Self::PARAM_MAP_RC(PARAM_MAP_RC_DATA::default())),
35688 PARAM_REQUEST_LIST_DATA::ID => {
35689 Some(Self::PARAM_REQUEST_LIST(PARAM_REQUEST_LIST_DATA::default()))
35690 }
35691 PARAM_REQUEST_READ_DATA::ID => {
35692 Some(Self::PARAM_REQUEST_READ(PARAM_REQUEST_READ_DATA::default()))
35693 }
35694 PARAM_SET_DATA::ID => Some(Self::PARAM_SET(PARAM_SET_DATA::default())),
35695 PARAM_VALUE_DATA::ID => Some(Self::PARAM_VALUE(PARAM_VALUE_DATA::default())),
35696 PING_DATA::ID => Some(Self::PING(PING_DATA::default())),
35697 PLAY_TUNE_DATA::ID => Some(Self::PLAY_TUNE(PLAY_TUNE_DATA::default())),
35698 PLAY_TUNE_V2_DATA::ID => Some(Self::PLAY_TUNE_V2(PLAY_TUNE_V2_DATA::default())),
35699 POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::POSITION_TARGET_GLOBAL_INT(
35700 POSITION_TARGET_GLOBAL_INT_DATA::default(),
35701 )),
35702 POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::POSITION_TARGET_LOCAL_NED(
35703 POSITION_TARGET_LOCAL_NED_DATA::default(),
35704 )),
35705 POWER_STATUS_DATA::ID => Some(Self::POWER_STATUS(POWER_STATUS_DATA::default())),
35706 PROTOCOL_VERSION_DATA::ID => {
35707 Some(Self::PROTOCOL_VERSION(PROTOCOL_VERSION_DATA::default()))
35708 }
35709 RADIO_STATUS_DATA::ID => Some(Self::RADIO_STATUS(RADIO_STATUS_DATA::default())),
35710 RAW_IMU_DATA::ID => Some(Self::RAW_IMU(RAW_IMU_DATA::default())),
35711 RAW_PRESSURE_DATA::ID => Some(Self::RAW_PRESSURE(RAW_PRESSURE_DATA::default())),
35712 RAW_RPM_DATA::ID => Some(Self::RAW_RPM(RAW_RPM_DATA::default())),
35713 RC_CHANNELS_DATA::ID => Some(Self::RC_CHANNELS(RC_CHANNELS_DATA::default())),
35714 RC_CHANNELS_OVERRIDE_DATA::ID => Some(Self::RC_CHANNELS_OVERRIDE(
35715 RC_CHANNELS_OVERRIDE_DATA::default(),
35716 )),
35717 RC_CHANNELS_RAW_DATA::ID => {
35718 Some(Self::RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA::default()))
35719 }
35720 RC_CHANNELS_SCALED_DATA::ID => {
35721 Some(Self::RC_CHANNELS_SCALED(RC_CHANNELS_SCALED_DATA::default()))
35722 }
35723 REQUEST_DATA_STREAM_DATA::ID => Some(Self::REQUEST_DATA_STREAM(
35724 REQUEST_DATA_STREAM_DATA::default(),
35725 )),
35726 REQUEST_EVENT_DATA::ID => Some(Self::REQUEST_EVENT(REQUEST_EVENT_DATA::default())),
35727 RESOURCE_REQUEST_DATA::ID => {
35728 Some(Self::RESOURCE_REQUEST(RESOURCE_REQUEST_DATA::default()))
35729 }
35730 RESPONSE_EVENT_ERROR_DATA::ID => Some(Self::RESPONSE_EVENT_ERROR(
35731 RESPONSE_EVENT_ERROR_DATA::default(),
35732 )),
35733 SAFETY_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_ALLOWED_AREA(
35734 SAFETY_ALLOWED_AREA_DATA::default(),
35735 )),
35736 SAFETY_SET_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_SET_ALLOWED_AREA(
35737 SAFETY_SET_ALLOWED_AREA_DATA::default(),
35738 )),
35739 SCALED_IMU_DATA::ID => Some(Self::SCALED_IMU(SCALED_IMU_DATA::default())),
35740 SCALED_IMU2_DATA::ID => Some(Self::SCALED_IMU2(SCALED_IMU2_DATA::default())),
35741 SCALED_IMU3_DATA::ID => Some(Self::SCALED_IMU3(SCALED_IMU3_DATA::default())),
35742 SCALED_PRESSURE_DATA::ID => {
35743 Some(Self::SCALED_PRESSURE(SCALED_PRESSURE_DATA::default()))
35744 }
35745 SCALED_PRESSURE2_DATA::ID => {
35746 Some(Self::SCALED_PRESSURE2(SCALED_PRESSURE2_DATA::default()))
35747 }
35748 SCALED_PRESSURE3_DATA::ID => {
35749 Some(Self::SCALED_PRESSURE3(SCALED_PRESSURE3_DATA::default()))
35750 }
35751 SERIAL_CONTROL_DATA::ID => Some(Self::SERIAL_CONTROL(SERIAL_CONTROL_DATA::default())),
35752 SERVO_OUTPUT_RAW_DATA::ID => {
35753 Some(Self::SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA::default()))
35754 }
35755 SETUP_SIGNING_DATA::ID => Some(Self::SETUP_SIGNING(SETUP_SIGNING_DATA::default())),
35756 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::SET_ACTUATOR_CONTROL_TARGET(
35757 SET_ACTUATOR_CONTROL_TARGET_DATA::default(),
35758 )),
35759 SET_ATTITUDE_TARGET_DATA::ID => Some(Self::SET_ATTITUDE_TARGET(
35760 SET_ATTITUDE_TARGET_DATA::default(),
35761 )),
35762 SET_GPS_GLOBAL_ORIGIN_DATA::ID => Some(Self::SET_GPS_GLOBAL_ORIGIN(
35763 SET_GPS_GLOBAL_ORIGIN_DATA::default(),
35764 )),
35765 SET_HOME_POSITION_DATA::ID => {
35766 Some(Self::SET_HOME_POSITION(SET_HOME_POSITION_DATA::default()))
35767 }
35768 SET_MODE_DATA::ID => Some(Self::SET_MODE(SET_MODE_DATA::default())),
35769 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::SET_POSITION_TARGET_GLOBAL_INT(
35770 SET_POSITION_TARGET_GLOBAL_INT_DATA::default(),
35771 )),
35772 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::SET_POSITION_TARGET_LOCAL_NED(
35773 SET_POSITION_TARGET_LOCAL_NED_DATA::default(),
35774 )),
35775 SIM_STATE_DATA::ID => Some(Self::SIM_STATE(SIM_STATE_DATA::default())),
35776 SMART_BATTERY_INFO_DATA::ID => {
35777 Some(Self::SMART_BATTERY_INFO(SMART_BATTERY_INFO_DATA::default()))
35778 }
35779 STATUSTEXT_DATA::ID => Some(Self::STATUSTEXT(STATUSTEXT_DATA::default())),
35780 STORAGE_INFORMATION_DATA::ID => Some(Self::STORAGE_INFORMATION(
35781 STORAGE_INFORMATION_DATA::default(),
35782 )),
35783 SUPPORTED_TUNES_DATA::ID => {
35784 Some(Self::SUPPORTED_TUNES(SUPPORTED_TUNES_DATA::default()))
35785 }
35786 SYSTEM_TIME_DATA::ID => Some(Self::SYSTEM_TIME(SYSTEM_TIME_DATA::default())),
35787 SYS_STATUS_DATA::ID => Some(Self::SYS_STATUS(SYS_STATUS_DATA::default())),
35788 TERRAIN_CHECK_DATA::ID => Some(Self::TERRAIN_CHECK(TERRAIN_CHECK_DATA::default())),
35789 TERRAIN_DATA_DATA::ID => Some(Self::TERRAIN_DATA(TERRAIN_DATA_DATA::default())),
35790 TERRAIN_REPORT_DATA::ID => Some(Self::TERRAIN_REPORT(TERRAIN_REPORT_DATA::default())),
35791 TERRAIN_REQUEST_DATA::ID => {
35792 Some(Self::TERRAIN_REQUEST(TERRAIN_REQUEST_DATA::default()))
35793 }
35794 TIMESYNC_DATA::ID => Some(Self::TIMESYNC(TIMESYNC_DATA::default())),
35795 TIME_ESTIMATE_TO_TARGET_DATA::ID => Some(Self::TIME_ESTIMATE_TO_TARGET(
35796 TIME_ESTIMATE_TO_TARGET_DATA::default(),
35797 )),
35798 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
35799 Some(Self::TRAJECTORY_REPRESENTATION_BEZIER(
35800 TRAJECTORY_REPRESENTATION_BEZIER_DATA::default(),
35801 ))
35802 }
35803 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
35804 Some(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(
35805 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::default(),
35806 ))
35807 }
35808 TUNNEL_DATA::ID => Some(Self::TUNNEL(TUNNEL_DATA::default())),
35809 UAVCAN_NODE_INFO_DATA::ID => {
35810 Some(Self::UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA::default()))
35811 }
35812 UAVCAN_NODE_STATUS_DATA::ID => {
35813 Some(Self::UAVCAN_NODE_STATUS(UAVCAN_NODE_STATUS_DATA::default()))
35814 }
35815 UTM_GLOBAL_POSITION_DATA::ID => Some(Self::UTM_GLOBAL_POSITION(
35816 UTM_GLOBAL_POSITION_DATA::default(),
35817 )),
35818 V2_EXTENSION_DATA::ID => Some(Self::V2_EXTENSION(V2_EXTENSION_DATA::default())),
35819 VFR_HUD_DATA::ID => Some(Self::VFR_HUD(VFR_HUD_DATA::default())),
35820 VIBRATION_DATA::ID => Some(Self::VIBRATION(VIBRATION_DATA::default())),
35821 VICON_POSITION_ESTIMATE_DATA::ID => Some(Self::VICON_POSITION_ESTIMATE(
35822 VICON_POSITION_ESTIMATE_DATA::default(),
35823 )),
35824 VIDEO_STREAM_INFORMATION_DATA::ID => Some(Self::VIDEO_STREAM_INFORMATION(
35825 VIDEO_STREAM_INFORMATION_DATA::default(),
35826 )),
35827 VIDEO_STREAM_STATUS_DATA::ID => Some(Self::VIDEO_STREAM_STATUS(
35828 VIDEO_STREAM_STATUS_DATA::default(),
35829 )),
35830 VISION_POSITION_ESTIMATE_DATA::ID => Some(Self::VISION_POSITION_ESTIMATE(
35831 VISION_POSITION_ESTIMATE_DATA::default(),
35832 )),
35833 VISION_SPEED_ESTIMATE_DATA::ID => Some(Self::VISION_SPEED_ESTIMATE(
35834 VISION_SPEED_ESTIMATE_DATA::default(),
35835 )),
35836 WHEEL_DISTANCE_DATA::ID => Some(Self::WHEEL_DISTANCE(WHEEL_DISTANCE_DATA::default())),
35837 WIFI_CONFIG_AP_DATA::ID => Some(Self::WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA::default())),
35838 WINCH_STATUS_DATA::ID => Some(Self::WINCH_STATUS(WINCH_STATUS_DATA::default())),
35839 WIND_COV_DATA::ID => Some(Self::WIND_COV(WIND_COV_DATA::default())),
35840 _ => None,
35841 }
35842 }
35843 #[cfg(feature = "arbitrary")]
35844 fn random_message_from_id<R: rand::RngCore>(id: u32, rng: &mut R) -> Option<Self> {
35845 match id {
35846 ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::ACTUATOR_CONTROL_TARGET(
35847 ACTUATOR_CONTROL_TARGET_DATA::random(rng),
35848 )),
35849 ACTUATOR_OUTPUT_STATUS_DATA::ID => Some(Self::ACTUATOR_OUTPUT_STATUS(
35850 ACTUATOR_OUTPUT_STATUS_DATA::random(rng),
35851 )),
35852 ADSB_VEHICLE_DATA::ID => Some(Self::ADSB_VEHICLE(ADSB_VEHICLE_DATA::random(rng))),
35853 AIS_VESSEL_DATA::ID => Some(Self::AIS_VESSEL(AIS_VESSEL_DATA::random(rng))),
35854 ALTITUDE_DATA::ID => Some(Self::ALTITUDE(ALTITUDE_DATA::random(rng))),
35855 ATTITUDE_DATA::ID => Some(Self::ATTITUDE(ATTITUDE_DATA::random(rng))),
35856 ATTITUDE_QUATERNION_DATA::ID => Some(Self::ATTITUDE_QUATERNION(
35857 ATTITUDE_QUATERNION_DATA::random(rng),
35858 )),
35859 ATTITUDE_QUATERNION_COV_DATA::ID => Some(Self::ATTITUDE_QUATERNION_COV(
35860 ATTITUDE_QUATERNION_COV_DATA::random(rng),
35861 )),
35862 ATTITUDE_TARGET_DATA::ID => {
35863 Some(Self::ATTITUDE_TARGET(ATTITUDE_TARGET_DATA::random(rng)))
35864 }
35865 ATT_POS_MOCAP_DATA::ID => Some(Self::ATT_POS_MOCAP(ATT_POS_MOCAP_DATA::random(rng))),
35866 AUTH_KEY_DATA::ID => Some(Self::AUTH_KEY(AUTH_KEY_DATA::random(rng))),
35867 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
35868 Some(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(
35869 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::random(rng),
35870 ))
35871 }
35872 AUTOPILOT_VERSION_DATA::ID => {
35873 Some(Self::AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA::random(rng)))
35874 }
35875 AVAILABLE_MODES_DATA::ID => {
35876 Some(Self::AVAILABLE_MODES(AVAILABLE_MODES_DATA::random(rng)))
35877 }
35878 AVAILABLE_MODES_MONITOR_DATA::ID => Some(Self::AVAILABLE_MODES_MONITOR(
35879 AVAILABLE_MODES_MONITOR_DATA::random(rng),
35880 )),
35881 AVSS_DRONE_IMU_DATA::ID => Some(Self::AVSS_DRONE_IMU(AVSS_DRONE_IMU_DATA::random(rng))),
35882 AVSS_DRONE_OPERATION_MODE_DATA::ID => Some(Self::AVSS_DRONE_OPERATION_MODE(
35883 AVSS_DRONE_OPERATION_MODE_DATA::random(rng),
35884 )),
35885 AVSS_DRONE_POSITION_DATA::ID => Some(Self::AVSS_DRONE_POSITION(
35886 AVSS_DRONE_POSITION_DATA::random(rng),
35887 )),
35888 AVSS_PRS_SYS_STATUS_DATA::ID => Some(Self::AVSS_PRS_SYS_STATUS(
35889 AVSS_PRS_SYS_STATUS_DATA::random(rng),
35890 )),
35891 BATTERY_INFO_DATA::ID => Some(Self::BATTERY_INFO(BATTERY_INFO_DATA::random(rng))),
35892 BATTERY_STATUS_DATA::ID => Some(Self::BATTERY_STATUS(BATTERY_STATUS_DATA::random(rng))),
35893 BUTTON_CHANGE_DATA::ID => Some(Self::BUTTON_CHANGE(BUTTON_CHANGE_DATA::random(rng))),
35894 CAMERA_CAPTURE_STATUS_DATA::ID => Some(Self::CAMERA_CAPTURE_STATUS(
35895 CAMERA_CAPTURE_STATUS_DATA::random(rng),
35896 )),
35897 CAMERA_FOV_STATUS_DATA::ID => {
35898 Some(Self::CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA::random(rng)))
35899 }
35900 CAMERA_IMAGE_CAPTURED_DATA::ID => Some(Self::CAMERA_IMAGE_CAPTURED(
35901 CAMERA_IMAGE_CAPTURED_DATA::random(rng),
35902 )),
35903 CAMERA_INFORMATION_DATA::ID => Some(Self::CAMERA_INFORMATION(
35904 CAMERA_INFORMATION_DATA::random(rng),
35905 )),
35906 CAMERA_SETTINGS_DATA::ID => {
35907 Some(Self::CAMERA_SETTINGS(CAMERA_SETTINGS_DATA::random(rng)))
35908 }
35909 CAMERA_THERMAL_RANGE_DATA::ID => Some(Self::CAMERA_THERMAL_RANGE(
35910 CAMERA_THERMAL_RANGE_DATA::random(rng),
35911 )),
35912 CAMERA_TRACKING_GEO_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_GEO_STATUS(
35913 CAMERA_TRACKING_GEO_STATUS_DATA::random(rng),
35914 )),
35915 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_IMAGE_STATUS(
35916 CAMERA_TRACKING_IMAGE_STATUS_DATA::random(rng),
35917 )),
35918 CAMERA_TRIGGER_DATA::ID => Some(Self::CAMERA_TRIGGER(CAMERA_TRIGGER_DATA::random(rng))),
35919 CANFD_FRAME_DATA::ID => Some(Self::CANFD_FRAME(CANFD_FRAME_DATA::random(rng))),
35920 CAN_FILTER_MODIFY_DATA::ID => {
35921 Some(Self::CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA::random(rng)))
35922 }
35923 CAN_FRAME_DATA::ID => Some(Self::CAN_FRAME(CAN_FRAME_DATA::random(rng))),
35924 CELLULAR_CONFIG_DATA::ID => {
35925 Some(Self::CELLULAR_CONFIG(CELLULAR_CONFIG_DATA::random(rng)))
35926 }
35927 CELLULAR_STATUS_DATA::ID => {
35928 Some(Self::CELLULAR_STATUS(CELLULAR_STATUS_DATA::random(rng)))
35929 }
35930 CHANGE_OPERATOR_CONTROL_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL(
35931 CHANGE_OPERATOR_CONTROL_DATA::random(rng),
35932 )),
35933 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL_ACK(
35934 CHANGE_OPERATOR_CONTROL_ACK_DATA::random(rng),
35935 )),
35936 COLLISION_DATA::ID => Some(Self::COLLISION(COLLISION_DATA::random(rng))),
35937 COMMAND_ACK_DATA::ID => Some(Self::COMMAND_ACK(COMMAND_ACK_DATA::random(rng))),
35938 COMMAND_CANCEL_DATA::ID => Some(Self::COMMAND_CANCEL(COMMAND_CANCEL_DATA::random(rng))),
35939 COMMAND_INT_DATA::ID => Some(Self::COMMAND_INT(COMMAND_INT_DATA::random(rng))),
35940 COMMAND_LONG_DATA::ID => Some(Self::COMMAND_LONG(COMMAND_LONG_DATA::random(rng))),
35941 COMPONENT_INFORMATION_DATA::ID => Some(Self::COMPONENT_INFORMATION(
35942 COMPONENT_INFORMATION_DATA::random(rng),
35943 )),
35944 COMPONENT_INFORMATION_BASIC_DATA::ID => Some(Self::COMPONENT_INFORMATION_BASIC(
35945 COMPONENT_INFORMATION_BASIC_DATA::random(rng),
35946 )),
35947 COMPONENT_METADATA_DATA::ID => Some(Self::COMPONENT_METADATA(
35948 COMPONENT_METADATA_DATA::random(rng),
35949 )),
35950 CONTROL_SYSTEM_STATE_DATA::ID => Some(Self::CONTROL_SYSTEM_STATE(
35951 CONTROL_SYSTEM_STATE_DATA::random(rng),
35952 )),
35953 CURRENT_EVENT_SEQUENCE_DATA::ID => Some(Self::CURRENT_EVENT_SEQUENCE(
35954 CURRENT_EVENT_SEQUENCE_DATA::random(rng),
35955 )),
35956 CURRENT_MODE_DATA::ID => Some(Self::CURRENT_MODE(CURRENT_MODE_DATA::random(rng))),
35957 DATA_STREAM_DATA::ID => Some(Self::DATA_STREAM(DATA_STREAM_DATA::random(rng))),
35958 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => Some(Self::DATA_TRANSMISSION_HANDSHAKE(
35959 DATA_TRANSMISSION_HANDSHAKE_DATA::random(rng),
35960 )),
35961 DEBUG_DATA::ID => Some(Self::DEBUG(DEBUG_DATA::random(rng))),
35962 DEBUG_FLOAT_ARRAY_DATA::ID => {
35963 Some(Self::DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA::random(rng)))
35964 }
35965 DEBUG_VECT_DATA::ID => Some(Self::DEBUG_VECT(DEBUG_VECT_DATA::random(rng))),
35966 DISTANCE_SENSOR_DATA::ID => {
35967 Some(Self::DISTANCE_SENSOR(DISTANCE_SENSOR_DATA::random(rng)))
35968 }
35969 EFI_STATUS_DATA::ID => Some(Self::EFI_STATUS(EFI_STATUS_DATA::random(rng))),
35970 ENCAPSULATED_DATA_DATA::ID => {
35971 Some(Self::ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA::random(rng)))
35972 }
35973 ESC_INFO_DATA::ID => Some(Self::ESC_INFO(ESC_INFO_DATA::random(rng))),
35974 ESC_STATUS_DATA::ID => Some(Self::ESC_STATUS(ESC_STATUS_DATA::random(rng))),
35975 ESTIMATOR_STATUS_DATA::ID => {
35976 Some(Self::ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA::random(rng)))
35977 }
35978 EVENT_DATA::ID => Some(Self::EVENT(EVENT_DATA::random(rng))),
35979 EXTENDED_SYS_STATE_DATA::ID => Some(Self::EXTENDED_SYS_STATE(
35980 EXTENDED_SYS_STATE_DATA::random(rng),
35981 )),
35982 FENCE_STATUS_DATA::ID => Some(Self::FENCE_STATUS(FENCE_STATUS_DATA::random(rng))),
35983 FILE_TRANSFER_PROTOCOL_DATA::ID => Some(Self::FILE_TRANSFER_PROTOCOL(
35984 FILE_TRANSFER_PROTOCOL_DATA::random(rng),
35985 )),
35986 FLIGHT_INFORMATION_DATA::ID => Some(Self::FLIGHT_INFORMATION(
35987 FLIGHT_INFORMATION_DATA::random(rng),
35988 )),
35989 FOLLOW_TARGET_DATA::ID => Some(Self::FOLLOW_TARGET(FOLLOW_TARGET_DATA::random(rng))),
35990 FUEL_STATUS_DATA::ID => Some(Self::FUEL_STATUS(FUEL_STATUS_DATA::random(rng))),
35991 GENERATOR_STATUS_DATA::ID => {
35992 Some(Self::GENERATOR_STATUS(GENERATOR_STATUS_DATA::random(rng)))
35993 }
35994 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => Some(Self::GIMBAL_DEVICE_ATTITUDE_STATUS(
35995 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::random(rng),
35996 )),
35997 GIMBAL_DEVICE_INFORMATION_DATA::ID => Some(Self::GIMBAL_DEVICE_INFORMATION(
35998 GIMBAL_DEVICE_INFORMATION_DATA::random(rng),
35999 )),
36000 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_DEVICE_SET_ATTITUDE(
36001 GIMBAL_DEVICE_SET_ATTITUDE_DATA::random(rng),
36002 )),
36003 GIMBAL_MANAGER_INFORMATION_DATA::ID => Some(Self::GIMBAL_MANAGER_INFORMATION(
36004 GIMBAL_MANAGER_INFORMATION_DATA::random(rng),
36005 )),
36006 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_ATTITUDE(
36007 GIMBAL_MANAGER_SET_ATTITUDE_DATA::random(rng),
36008 )),
36009 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
36010 Some(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(
36011 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::random(rng),
36012 ))
36013 }
36014 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_PITCHYAW(
36015 GIMBAL_MANAGER_SET_PITCHYAW_DATA::random(rng),
36016 )),
36017 GIMBAL_MANAGER_STATUS_DATA::ID => Some(Self::GIMBAL_MANAGER_STATUS(
36018 GIMBAL_MANAGER_STATUS_DATA::random(rng),
36019 )),
36020 GLOBAL_POSITION_INT_DATA::ID => Some(Self::GLOBAL_POSITION_INT(
36021 GLOBAL_POSITION_INT_DATA::random(rng),
36022 )),
36023 GLOBAL_POSITION_INT_COV_DATA::ID => Some(Self::GLOBAL_POSITION_INT_COV(
36024 GLOBAL_POSITION_INT_COV_DATA::random(rng),
36025 )),
36026 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
36027 Some(Self::GLOBAL_VISION_POSITION_ESTIMATE(
36028 GLOBAL_VISION_POSITION_ESTIMATE_DATA::random(rng),
36029 ))
36030 }
36031 GPS2_RAW_DATA::ID => Some(Self::GPS2_RAW(GPS2_RAW_DATA::random(rng))),
36032 GPS2_RTK_DATA::ID => Some(Self::GPS2_RTK(GPS2_RTK_DATA::random(rng))),
36033 GPS_GLOBAL_ORIGIN_DATA::ID => {
36034 Some(Self::GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA::random(rng)))
36035 }
36036 GPS_INJECT_DATA_DATA::ID => {
36037 Some(Self::GPS_INJECT_DATA(GPS_INJECT_DATA_DATA::random(rng)))
36038 }
36039 GPS_INPUT_DATA::ID => Some(Self::GPS_INPUT(GPS_INPUT_DATA::random(rng))),
36040 GPS_RAW_INT_DATA::ID => Some(Self::GPS_RAW_INT(GPS_RAW_INT_DATA::random(rng))),
36041 GPS_RTCM_DATA_DATA::ID => Some(Self::GPS_RTCM_DATA(GPS_RTCM_DATA_DATA::random(rng))),
36042 GPS_RTK_DATA::ID => Some(Self::GPS_RTK(GPS_RTK_DATA::random(rng))),
36043 GPS_STATUS_DATA::ID => Some(Self::GPS_STATUS(GPS_STATUS_DATA::random(rng))),
36044 HEARTBEAT_DATA::ID => Some(Self::HEARTBEAT(HEARTBEAT_DATA::random(rng))),
36045 HIGHRES_IMU_DATA::ID => Some(Self::HIGHRES_IMU(HIGHRES_IMU_DATA::random(rng))),
36046 HIGH_LATENCY_DATA::ID => Some(Self::HIGH_LATENCY(HIGH_LATENCY_DATA::random(rng))),
36047 HIGH_LATENCY2_DATA::ID => Some(Self::HIGH_LATENCY2(HIGH_LATENCY2_DATA::random(rng))),
36048 HIL_ACTUATOR_CONTROLS_DATA::ID => Some(Self::HIL_ACTUATOR_CONTROLS(
36049 HIL_ACTUATOR_CONTROLS_DATA::random(rng),
36050 )),
36051 HIL_CONTROLS_DATA::ID => Some(Self::HIL_CONTROLS(HIL_CONTROLS_DATA::random(rng))),
36052 HIL_GPS_DATA::ID => Some(Self::HIL_GPS(HIL_GPS_DATA::random(rng))),
36053 HIL_OPTICAL_FLOW_DATA::ID => {
36054 Some(Self::HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA::random(rng)))
36055 }
36056 HIL_RC_INPUTS_RAW_DATA::ID => {
36057 Some(Self::HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA::random(rng)))
36058 }
36059 HIL_SENSOR_DATA::ID => Some(Self::HIL_SENSOR(HIL_SENSOR_DATA::random(rng))),
36060 HIL_STATE_DATA::ID => Some(Self::HIL_STATE(HIL_STATE_DATA::random(rng))),
36061 HIL_STATE_QUATERNION_DATA::ID => Some(Self::HIL_STATE_QUATERNION(
36062 HIL_STATE_QUATERNION_DATA::random(rng),
36063 )),
36064 HOME_POSITION_DATA::ID => Some(Self::HOME_POSITION(HOME_POSITION_DATA::random(rng))),
36065 HYGROMETER_SENSOR_DATA::ID => {
36066 Some(Self::HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA::random(rng)))
36067 }
36068 ILLUMINATOR_STATUS_DATA::ID => Some(Self::ILLUMINATOR_STATUS(
36069 ILLUMINATOR_STATUS_DATA::random(rng),
36070 )),
36071 ISBD_LINK_STATUS_DATA::ID => {
36072 Some(Self::ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA::random(rng)))
36073 }
36074 LANDING_TARGET_DATA::ID => Some(Self::LANDING_TARGET(LANDING_TARGET_DATA::random(rng))),
36075 LINK_NODE_STATUS_DATA::ID => {
36076 Some(Self::LINK_NODE_STATUS(LINK_NODE_STATUS_DATA::random(rng)))
36077 }
36078 LOCAL_POSITION_NED_DATA::ID => Some(Self::LOCAL_POSITION_NED(
36079 LOCAL_POSITION_NED_DATA::random(rng),
36080 )),
36081 LOCAL_POSITION_NED_COV_DATA::ID => Some(Self::LOCAL_POSITION_NED_COV(
36082 LOCAL_POSITION_NED_COV_DATA::random(rng),
36083 )),
36084 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
36085 Some(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(
36086 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::random(rng),
36087 ))
36088 }
36089 LOGGING_ACK_DATA::ID => Some(Self::LOGGING_ACK(LOGGING_ACK_DATA::random(rng))),
36090 LOGGING_DATA_DATA::ID => Some(Self::LOGGING_DATA(LOGGING_DATA_DATA::random(rng))),
36091 LOGGING_DATA_ACKED_DATA::ID => Some(Self::LOGGING_DATA_ACKED(
36092 LOGGING_DATA_ACKED_DATA::random(rng),
36093 )),
36094 LOG_DATA_DATA::ID => Some(Self::LOG_DATA(LOG_DATA_DATA::random(rng))),
36095 LOG_ENTRY_DATA::ID => Some(Self::LOG_ENTRY(LOG_ENTRY_DATA::random(rng))),
36096 LOG_ERASE_DATA::ID => Some(Self::LOG_ERASE(LOG_ERASE_DATA::random(rng))),
36097 LOG_REQUEST_DATA_DATA::ID => {
36098 Some(Self::LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA::random(rng)))
36099 }
36100 LOG_REQUEST_END_DATA::ID => {
36101 Some(Self::LOG_REQUEST_END(LOG_REQUEST_END_DATA::random(rng)))
36102 }
36103 LOG_REQUEST_LIST_DATA::ID => {
36104 Some(Self::LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA::random(rng)))
36105 }
36106 MAG_CAL_REPORT_DATA::ID => Some(Self::MAG_CAL_REPORT(MAG_CAL_REPORT_DATA::random(rng))),
36107 MANUAL_CONTROL_DATA::ID => Some(Self::MANUAL_CONTROL(MANUAL_CONTROL_DATA::random(rng))),
36108 MANUAL_SETPOINT_DATA::ID => {
36109 Some(Self::MANUAL_SETPOINT(MANUAL_SETPOINT_DATA::random(rng)))
36110 }
36111 MEMORY_VECT_DATA::ID => Some(Self::MEMORY_VECT(MEMORY_VECT_DATA::random(rng))),
36112 MESSAGE_INTERVAL_DATA::ID => {
36113 Some(Self::MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA::random(rng)))
36114 }
36115 MISSION_ACK_DATA::ID => Some(Self::MISSION_ACK(MISSION_ACK_DATA::random(rng))),
36116 MISSION_CLEAR_ALL_DATA::ID => {
36117 Some(Self::MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA::random(rng)))
36118 }
36119 MISSION_COUNT_DATA::ID => Some(Self::MISSION_COUNT(MISSION_COUNT_DATA::random(rng))),
36120 MISSION_CURRENT_DATA::ID => {
36121 Some(Self::MISSION_CURRENT(MISSION_CURRENT_DATA::random(rng)))
36122 }
36123 MISSION_ITEM_DATA::ID => Some(Self::MISSION_ITEM(MISSION_ITEM_DATA::random(rng))),
36124 MISSION_ITEM_INT_DATA::ID => {
36125 Some(Self::MISSION_ITEM_INT(MISSION_ITEM_INT_DATA::random(rng)))
36126 }
36127 MISSION_ITEM_REACHED_DATA::ID => Some(Self::MISSION_ITEM_REACHED(
36128 MISSION_ITEM_REACHED_DATA::random(rng),
36129 )),
36130 MISSION_REQUEST_DATA::ID => {
36131 Some(Self::MISSION_REQUEST(MISSION_REQUEST_DATA::random(rng)))
36132 }
36133 MISSION_REQUEST_INT_DATA::ID => Some(Self::MISSION_REQUEST_INT(
36134 MISSION_REQUEST_INT_DATA::random(rng),
36135 )),
36136 MISSION_REQUEST_LIST_DATA::ID => Some(Self::MISSION_REQUEST_LIST(
36137 MISSION_REQUEST_LIST_DATA::random(rng),
36138 )),
36139 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_REQUEST_PARTIAL_LIST(
36140 MISSION_REQUEST_PARTIAL_LIST_DATA::random(rng),
36141 )),
36142 MISSION_SET_CURRENT_DATA::ID => Some(Self::MISSION_SET_CURRENT(
36143 MISSION_SET_CURRENT_DATA::random(rng),
36144 )),
36145 MISSION_WRITE_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_WRITE_PARTIAL_LIST(
36146 MISSION_WRITE_PARTIAL_LIST_DATA::random(rng),
36147 )),
36148 MOUNT_ORIENTATION_DATA::ID => {
36149 Some(Self::MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA::random(rng)))
36150 }
36151 NAMED_VALUE_FLOAT_DATA::ID => {
36152 Some(Self::NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA::random(rng)))
36153 }
36154 NAMED_VALUE_INT_DATA::ID => {
36155 Some(Self::NAMED_VALUE_INT(NAMED_VALUE_INT_DATA::random(rng)))
36156 }
36157 NAV_CONTROLLER_OUTPUT_DATA::ID => Some(Self::NAV_CONTROLLER_OUTPUT(
36158 NAV_CONTROLLER_OUTPUT_DATA::random(rng),
36159 )),
36160 OBSTACLE_DISTANCE_DATA::ID => {
36161 Some(Self::OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA::random(rng)))
36162 }
36163 ODOMETRY_DATA::ID => Some(Self::ODOMETRY(ODOMETRY_DATA::random(rng))),
36164 ONBOARD_COMPUTER_STATUS_DATA::ID => Some(Self::ONBOARD_COMPUTER_STATUS(
36165 ONBOARD_COMPUTER_STATUS_DATA::random(rng),
36166 )),
36167 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => Some(Self::OPEN_DRONE_ID_ARM_STATUS(
36168 OPEN_DRONE_ID_ARM_STATUS_DATA::random(rng),
36169 )),
36170 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => Some(Self::OPEN_DRONE_ID_AUTHENTICATION(
36171 OPEN_DRONE_ID_AUTHENTICATION_DATA::random(rng),
36172 )),
36173 OPEN_DRONE_ID_BASIC_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_BASIC_ID(
36174 OPEN_DRONE_ID_BASIC_ID_DATA::random(rng),
36175 )),
36176 OPEN_DRONE_ID_LOCATION_DATA::ID => Some(Self::OPEN_DRONE_ID_LOCATION(
36177 OPEN_DRONE_ID_LOCATION_DATA::random(rng),
36178 )),
36179 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => Some(Self::OPEN_DRONE_ID_MESSAGE_PACK(
36180 OPEN_DRONE_ID_MESSAGE_PACK_DATA::random(rng),
36181 )),
36182 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_OPERATOR_ID(
36183 OPEN_DRONE_ID_OPERATOR_ID_DATA::random(rng),
36184 )),
36185 OPEN_DRONE_ID_SELF_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_SELF_ID(
36186 OPEN_DRONE_ID_SELF_ID_DATA::random(rng),
36187 )),
36188 OPEN_DRONE_ID_SYSTEM_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM(
36189 OPEN_DRONE_ID_SYSTEM_DATA::random(rng),
36190 )),
36191 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM_UPDATE(
36192 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::random(rng),
36193 )),
36194 OPTICAL_FLOW_DATA::ID => Some(Self::OPTICAL_FLOW(OPTICAL_FLOW_DATA::random(rng))),
36195 OPTICAL_FLOW_RAD_DATA::ID => {
36196 Some(Self::OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA::random(rng)))
36197 }
36198 ORBIT_EXECUTION_STATUS_DATA::ID => Some(Self::ORBIT_EXECUTION_STATUS(
36199 ORBIT_EXECUTION_STATUS_DATA::random(rng),
36200 )),
36201 PARAM_EXT_ACK_DATA::ID => Some(Self::PARAM_EXT_ACK(PARAM_EXT_ACK_DATA::random(rng))),
36202 PARAM_EXT_REQUEST_LIST_DATA::ID => Some(Self::PARAM_EXT_REQUEST_LIST(
36203 PARAM_EXT_REQUEST_LIST_DATA::random(rng),
36204 )),
36205 PARAM_EXT_REQUEST_READ_DATA::ID => Some(Self::PARAM_EXT_REQUEST_READ(
36206 PARAM_EXT_REQUEST_READ_DATA::random(rng),
36207 )),
36208 PARAM_EXT_SET_DATA::ID => Some(Self::PARAM_EXT_SET(PARAM_EXT_SET_DATA::random(rng))),
36209 PARAM_EXT_VALUE_DATA::ID => {
36210 Some(Self::PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA::random(rng)))
36211 }
36212 PARAM_MAP_RC_DATA::ID => Some(Self::PARAM_MAP_RC(PARAM_MAP_RC_DATA::random(rng))),
36213 PARAM_REQUEST_LIST_DATA::ID => Some(Self::PARAM_REQUEST_LIST(
36214 PARAM_REQUEST_LIST_DATA::random(rng),
36215 )),
36216 PARAM_REQUEST_READ_DATA::ID => Some(Self::PARAM_REQUEST_READ(
36217 PARAM_REQUEST_READ_DATA::random(rng),
36218 )),
36219 PARAM_SET_DATA::ID => Some(Self::PARAM_SET(PARAM_SET_DATA::random(rng))),
36220 PARAM_VALUE_DATA::ID => Some(Self::PARAM_VALUE(PARAM_VALUE_DATA::random(rng))),
36221 PING_DATA::ID => Some(Self::PING(PING_DATA::random(rng))),
36222 PLAY_TUNE_DATA::ID => Some(Self::PLAY_TUNE(PLAY_TUNE_DATA::random(rng))),
36223 PLAY_TUNE_V2_DATA::ID => Some(Self::PLAY_TUNE_V2(PLAY_TUNE_V2_DATA::random(rng))),
36224 POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::POSITION_TARGET_GLOBAL_INT(
36225 POSITION_TARGET_GLOBAL_INT_DATA::random(rng),
36226 )),
36227 POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::POSITION_TARGET_LOCAL_NED(
36228 POSITION_TARGET_LOCAL_NED_DATA::random(rng),
36229 )),
36230 POWER_STATUS_DATA::ID => Some(Self::POWER_STATUS(POWER_STATUS_DATA::random(rng))),
36231 PROTOCOL_VERSION_DATA::ID => {
36232 Some(Self::PROTOCOL_VERSION(PROTOCOL_VERSION_DATA::random(rng)))
36233 }
36234 RADIO_STATUS_DATA::ID => Some(Self::RADIO_STATUS(RADIO_STATUS_DATA::random(rng))),
36235 RAW_IMU_DATA::ID => Some(Self::RAW_IMU(RAW_IMU_DATA::random(rng))),
36236 RAW_PRESSURE_DATA::ID => Some(Self::RAW_PRESSURE(RAW_PRESSURE_DATA::random(rng))),
36237 RAW_RPM_DATA::ID => Some(Self::RAW_RPM(RAW_RPM_DATA::random(rng))),
36238 RC_CHANNELS_DATA::ID => Some(Self::RC_CHANNELS(RC_CHANNELS_DATA::random(rng))),
36239 RC_CHANNELS_OVERRIDE_DATA::ID => Some(Self::RC_CHANNELS_OVERRIDE(
36240 RC_CHANNELS_OVERRIDE_DATA::random(rng),
36241 )),
36242 RC_CHANNELS_RAW_DATA::ID => {
36243 Some(Self::RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA::random(rng)))
36244 }
36245 RC_CHANNELS_SCALED_DATA::ID => Some(Self::RC_CHANNELS_SCALED(
36246 RC_CHANNELS_SCALED_DATA::random(rng),
36247 )),
36248 REQUEST_DATA_STREAM_DATA::ID => Some(Self::REQUEST_DATA_STREAM(
36249 REQUEST_DATA_STREAM_DATA::random(rng),
36250 )),
36251 REQUEST_EVENT_DATA::ID => Some(Self::REQUEST_EVENT(REQUEST_EVENT_DATA::random(rng))),
36252 RESOURCE_REQUEST_DATA::ID => {
36253 Some(Self::RESOURCE_REQUEST(RESOURCE_REQUEST_DATA::random(rng)))
36254 }
36255 RESPONSE_EVENT_ERROR_DATA::ID => Some(Self::RESPONSE_EVENT_ERROR(
36256 RESPONSE_EVENT_ERROR_DATA::random(rng),
36257 )),
36258 SAFETY_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_ALLOWED_AREA(
36259 SAFETY_ALLOWED_AREA_DATA::random(rng),
36260 )),
36261 SAFETY_SET_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_SET_ALLOWED_AREA(
36262 SAFETY_SET_ALLOWED_AREA_DATA::random(rng),
36263 )),
36264 SCALED_IMU_DATA::ID => Some(Self::SCALED_IMU(SCALED_IMU_DATA::random(rng))),
36265 SCALED_IMU2_DATA::ID => Some(Self::SCALED_IMU2(SCALED_IMU2_DATA::random(rng))),
36266 SCALED_IMU3_DATA::ID => Some(Self::SCALED_IMU3(SCALED_IMU3_DATA::random(rng))),
36267 SCALED_PRESSURE_DATA::ID => {
36268 Some(Self::SCALED_PRESSURE(SCALED_PRESSURE_DATA::random(rng)))
36269 }
36270 SCALED_PRESSURE2_DATA::ID => {
36271 Some(Self::SCALED_PRESSURE2(SCALED_PRESSURE2_DATA::random(rng)))
36272 }
36273 SCALED_PRESSURE3_DATA::ID => {
36274 Some(Self::SCALED_PRESSURE3(SCALED_PRESSURE3_DATA::random(rng)))
36275 }
36276 SERIAL_CONTROL_DATA::ID => Some(Self::SERIAL_CONTROL(SERIAL_CONTROL_DATA::random(rng))),
36277 SERVO_OUTPUT_RAW_DATA::ID => {
36278 Some(Self::SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA::random(rng)))
36279 }
36280 SETUP_SIGNING_DATA::ID => Some(Self::SETUP_SIGNING(SETUP_SIGNING_DATA::random(rng))),
36281 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::SET_ACTUATOR_CONTROL_TARGET(
36282 SET_ACTUATOR_CONTROL_TARGET_DATA::random(rng),
36283 )),
36284 SET_ATTITUDE_TARGET_DATA::ID => Some(Self::SET_ATTITUDE_TARGET(
36285 SET_ATTITUDE_TARGET_DATA::random(rng),
36286 )),
36287 SET_GPS_GLOBAL_ORIGIN_DATA::ID => Some(Self::SET_GPS_GLOBAL_ORIGIN(
36288 SET_GPS_GLOBAL_ORIGIN_DATA::random(rng),
36289 )),
36290 SET_HOME_POSITION_DATA::ID => {
36291 Some(Self::SET_HOME_POSITION(SET_HOME_POSITION_DATA::random(rng)))
36292 }
36293 SET_MODE_DATA::ID => Some(Self::SET_MODE(SET_MODE_DATA::random(rng))),
36294 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::SET_POSITION_TARGET_GLOBAL_INT(
36295 SET_POSITION_TARGET_GLOBAL_INT_DATA::random(rng),
36296 )),
36297 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::SET_POSITION_TARGET_LOCAL_NED(
36298 SET_POSITION_TARGET_LOCAL_NED_DATA::random(rng),
36299 )),
36300 SIM_STATE_DATA::ID => Some(Self::SIM_STATE(SIM_STATE_DATA::random(rng))),
36301 SMART_BATTERY_INFO_DATA::ID => Some(Self::SMART_BATTERY_INFO(
36302 SMART_BATTERY_INFO_DATA::random(rng),
36303 )),
36304 STATUSTEXT_DATA::ID => Some(Self::STATUSTEXT(STATUSTEXT_DATA::random(rng))),
36305 STORAGE_INFORMATION_DATA::ID => Some(Self::STORAGE_INFORMATION(
36306 STORAGE_INFORMATION_DATA::random(rng),
36307 )),
36308 SUPPORTED_TUNES_DATA::ID => {
36309 Some(Self::SUPPORTED_TUNES(SUPPORTED_TUNES_DATA::random(rng)))
36310 }
36311 SYSTEM_TIME_DATA::ID => Some(Self::SYSTEM_TIME(SYSTEM_TIME_DATA::random(rng))),
36312 SYS_STATUS_DATA::ID => Some(Self::SYS_STATUS(SYS_STATUS_DATA::random(rng))),
36313 TERRAIN_CHECK_DATA::ID => Some(Self::TERRAIN_CHECK(TERRAIN_CHECK_DATA::random(rng))),
36314 TERRAIN_DATA_DATA::ID => Some(Self::TERRAIN_DATA(TERRAIN_DATA_DATA::random(rng))),
36315 TERRAIN_REPORT_DATA::ID => Some(Self::TERRAIN_REPORT(TERRAIN_REPORT_DATA::random(rng))),
36316 TERRAIN_REQUEST_DATA::ID => {
36317 Some(Self::TERRAIN_REQUEST(TERRAIN_REQUEST_DATA::random(rng)))
36318 }
36319 TIMESYNC_DATA::ID => Some(Self::TIMESYNC(TIMESYNC_DATA::random(rng))),
36320 TIME_ESTIMATE_TO_TARGET_DATA::ID => Some(Self::TIME_ESTIMATE_TO_TARGET(
36321 TIME_ESTIMATE_TO_TARGET_DATA::random(rng),
36322 )),
36323 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
36324 Some(Self::TRAJECTORY_REPRESENTATION_BEZIER(
36325 TRAJECTORY_REPRESENTATION_BEZIER_DATA::random(rng),
36326 ))
36327 }
36328 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
36329 Some(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(
36330 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::random(rng),
36331 ))
36332 }
36333 TUNNEL_DATA::ID => Some(Self::TUNNEL(TUNNEL_DATA::random(rng))),
36334 UAVCAN_NODE_INFO_DATA::ID => {
36335 Some(Self::UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA::random(rng)))
36336 }
36337 UAVCAN_NODE_STATUS_DATA::ID => Some(Self::UAVCAN_NODE_STATUS(
36338 UAVCAN_NODE_STATUS_DATA::random(rng),
36339 )),
36340 UTM_GLOBAL_POSITION_DATA::ID => Some(Self::UTM_GLOBAL_POSITION(
36341 UTM_GLOBAL_POSITION_DATA::random(rng),
36342 )),
36343 V2_EXTENSION_DATA::ID => Some(Self::V2_EXTENSION(V2_EXTENSION_DATA::random(rng))),
36344 VFR_HUD_DATA::ID => Some(Self::VFR_HUD(VFR_HUD_DATA::random(rng))),
36345 VIBRATION_DATA::ID => Some(Self::VIBRATION(VIBRATION_DATA::random(rng))),
36346 VICON_POSITION_ESTIMATE_DATA::ID => Some(Self::VICON_POSITION_ESTIMATE(
36347 VICON_POSITION_ESTIMATE_DATA::random(rng),
36348 )),
36349 VIDEO_STREAM_INFORMATION_DATA::ID => Some(Self::VIDEO_STREAM_INFORMATION(
36350 VIDEO_STREAM_INFORMATION_DATA::random(rng),
36351 )),
36352 VIDEO_STREAM_STATUS_DATA::ID => Some(Self::VIDEO_STREAM_STATUS(
36353 VIDEO_STREAM_STATUS_DATA::random(rng),
36354 )),
36355 VISION_POSITION_ESTIMATE_DATA::ID => Some(Self::VISION_POSITION_ESTIMATE(
36356 VISION_POSITION_ESTIMATE_DATA::random(rng),
36357 )),
36358 VISION_SPEED_ESTIMATE_DATA::ID => Some(Self::VISION_SPEED_ESTIMATE(
36359 VISION_SPEED_ESTIMATE_DATA::random(rng),
36360 )),
36361 WHEEL_DISTANCE_DATA::ID => Some(Self::WHEEL_DISTANCE(WHEEL_DISTANCE_DATA::random(rng))),
36362 WIFI_CONFIG_AP_DATA::ID => Some(Self::WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA::random(rng))),
36363 WINCH_STATUS_DATA::ID => Some(Self::WINCH_STATUS(WINCH_STATUS_DATA::random(rng))),
36364 WIND_COV_DATA::ID => Some(Self::WIND_COV(WIND_COV_DATA::random(rng))),
36365 _ => None,
36366 }
36367 }
36368 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
36369 match self {
36370 Self::ACTUATOR_CONTROL_TARGET(body) => body.ser(version, bytes),
36371 Self::ACTUATOR_OUTPUT_STATUS(body) => body.ser(version, bytes),
36372 Self::ADSB_VEHICLE(body) => body.ser(version, bytes),
36373 Self::AIS_VESSEL(body) => body.ser(version, bytes),
36374 Self::ALTITUDE(body) => body.ser(version, bytes),
36375 Self::ATTITUDE(body) => body.ser(version, bytes),
36376 Self::ATTITUDE_QUATERNION(body) => body.ser(version, bytes),
36377 Self::ATTITUDE_QUATERNION_COV(body) => body.ser(version, bytes),
36378 Self::ATTITUDE_TARGET(body) => body.ser(version, bytes),
36379 Self::ATT_POS_MOCAP(body) => body.ser(version, bytes),
36380 Self::AUTH_KEY(body) => body.ser(version, bytes),
36381 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(body) => body.ser(version, bytes),
36382 Self::AUTOPILOT_VERSION(body) => body.ser(version, bytes),
36383 Self::AVAILABLE_MODES(body) => body.ser(version, bytes),
36384 Self::AVAILABLE_MODES_MONITOR(body) => body.ser(version, bytes),
36385 Self::AVSS_DRONE_IMU(body) => body.ser(version, bytes),
36386 Self::AVSS_DRONE_OPERATION_MODE(body) => body.ser(version, bytes),
36387 Self::AVSS_DRONE_POSITION(body) => body.ser(version, bytes),
36388 Self::AVSS_PRS_SYS_STATUS(body) => body.ser(version, bytes),
36389 Self::BATTERY_INFO(body) => body.ser(version, bytes),
36390 Self::BATTERY_STATUS(body) => body.ser(version, bytes),
36391 Self::BUTTON_CHANGE(body) => body.ser(version, bytes),
36392 Self::CAMERA_CAPTURE_STATUS(body) => body.ser(version, bytes),
36393 Self::CAMERA_FOV_STATUS(body) => body.ser(version, bytes),
36394 Self::CAMERA_IMAGE_CAPTURED(body) => body.ser(version, bytes),
36395 Self::CAMERA_INFORMATION(body) => body.ser(version, bytes),
36396 Self::CAMERA_SETTINGS(body) => body.ser(version, bytes),
36397 Self::CAMERA_THERMAL_RANGE(body) => body.ser(version, bytes),
36398 Self::CAMERA_TRACKING_GEO_STATUS(body) => body.ser(version, bytes),
36399 Self::CAMERA_TRACKING_IMAGE_STATUS(body) => body.ser(version, bytes),
36400 Self::CAMERA_TRIGGER(body) => body.ser(version, bytes),
36401 Self::CANFD_FRAME(body) => body.ser(version, bytes),
36402 Self::CAN_FILTER_MODIFY(body) => body.ser(version, bytes),
36403 Self::CAN_FRAME(body) => body.ser(version, bytes),
36404 Self::CELLULAR_CONFIG(body) => body.ser(version, bytes),
36405 Self::CELLULAR_STATUS(body) => body.ser(version, bytes),
36406 Self::CHANGE_OPERATOR_CONTROL(body) => body.ser(version, bytes),
36407 Self::CHANGE_OPERATOR_CONTROL_ACK(body) => body.ser(version, bytes),
36408 Self::COLLISION(body) => body.ser(version, bytes),
36409 Self::COMMAND_ACK(body) => body.ser(version, bytes),
36410 Self::COMMAND_CANCEL(body) => body.ser(version, bytes),
36411 Self::COMMAND_INT(body) => body.ser(version, bytes),
36412 Self::COMMAND_LONG(body) => body.ser(version, bytes),
36413 Self::COMPONENT_INFORMATION(body) => body.ser(version, bytes),
36414 Self::COMPONENT_INFORMATION_BASIC(body) => body.ser(version, bytes),
36415 Self::COMPONENT_METADATA(body) => body.ser(version, bytes),
36416 Self::CONTROL_SYSTEM_STATE(body) => body.ser(version, bytes),
36417 Self::CURRENT_EVENT_SEQUENCE(body) => body.ser(version, bytes),
36418 Self::CURRENT_MODE(body) => body.ser(version, bytes),
36419 Self::DATA_STREAM(body) => body.ser(version, bytes),
36420 Self::DATA_TRANSMISSION_HANDSHAKE(body) => body.ser(version, bytes),
36421 Self::DEBUG(body) => body.ser(version, bytes),
36422 Self::DEBUG_FLOAT_ARRAY(body) => body.ser(version, bytes),
36423 Self::DEBUG_VECT(body) => body.ser(version, bytes),
36424 Self::DISTANCE_SENSOR(body) => body.ser(version, bytes),
36425 Self::EFI_STATUS(body) => body.ser(version, bytes),
36426 Self::ENCAPSULATED_DATA(body) => body.ser(version, bytes),
36427 Self::ESC_INFO(body) => body.ser(version, bytes),
36428 Self::ESC_STATUS(body) => body.ser(version, bytes),
36429 Self::ESTIMATOR_STATUS(body) => body.ser(version, bytes),
36430 Self::EVENT(body) => body.ser(version, bytes),
36431 Self::EXTENDED_SYS_STATE(body) => body.ser(version, bytes),
36432 Self::FENCE_STATUS(body) => body.ser(version, bytes),
36433 Self::FILE_TRANSFER_PROTOCOL(body) => body.ser(version, bytes),
36434 Self::FLIGHT_INFORMATION(body) => body.ser(version, bytes),
36435 Self::FOLLOW_TARGET(body) => body.ser(version, bytes),
36436 Self::FUEL_STATUS(body) => body.ser(version, bytes),
36437 Self::GENERATOR_STATUS(body) => body.ser(version, bytes),
36438 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(body) => body.ser(version, bytes),
36439 Self::GIMBAL_DEVICE_INFORMATION(body) => body.ser(version, bytes),
36440 Self::GIMBAL_DEVICE_SET_ATTITUDE(body) => body.ser(version, bytes),
36441 Self::GIMBAL_MANAGER_INFORMATION(body) => body.ser(version, bytes),
36442 Self::GIMBAL_MANAGER_SET_ATTITUDE(body) => body.ser(version, bytes),
36443 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(body) => body.ser(version, bytes),
36444 Self::GIMBAL_MANAGER_SET_PITCHYAW(body) => body.ser(version, bytes),
36445 Self::GIMBAL_MANAGER_STATUS(body) => body.ser(version, bytes),
36446 Self::GLOBAL_POSITION_INT(body) => body.ser(version, bytes),
36447 Self::GLOBAL_POSITION_INT_COV(body) => body.ser(version, bytes),
36448 Self::GLOBAL_VISION_POSITION_ESTIMATE(body) => body.ser(version, bytes),
36449 Self::GPS2_RAW(body) => body.ser(version, bytes),
36450 Self::GPS2_RTK(body) => body.ser(version, bytes),
36451 Self::GPS_GLOBAL_ORIGIN(body) => body.ser(version, bytes),
36452 Self::GPS_INJECT_DATA(body) => body.ser(version, bytes),
36453 Self::GPS_INPUT(body) => body.ser(version, bytes),
36454 Self::GPS_RAW_INT(body) => body.ser(version, bytes),
36455 Self::GPS_RTCM_DATA(body) => body.ser(version, bytes),
36456 Self::GPS_RTK(body) => body.ser(version, bytes),
36457 Self::GPS_STATUS(body) => body.ser(version, bytes),
36458 Self::HEARTBEAT(body) => body.ser(version, bytes),
36459 Self::HIGHRES_IMU(body) => body.ser(version, bytes),
36460 Self::HIGH_LATENCY(body) => body.ser(version, bytes),
36461 Self::HIGH_LATENCY2(body) => body.ser(version, bytes),
36462 Self::HIL_ACTUATOR_CONTROLS(body) => body.ser(version, bytes),
36463 Self::HIL_CONTROLS(body) => body.ser(version, bytes),
36464 Self::HIL_GPS(body) => body.ser(version, bytes),
36465 Self::HIL_OPTICAL_FLOW(body) => body.ser(version, bytes),
36466 Self::HIL_RC_INPUTS_RAW(body) => body.ser(version, bytes),
36467 Self::HIL_SENSOR(body) => body.ser(version, bytes),
36468 Self::HIL_STATE(body) => body.ser(version, bytes),
36469 Self::HIL_STATE_QUATERNION(body) => body.ser(version, bytes),
36470 Self::HOME_POSITION(body) => body.ser(version, bytes),
36471 Self::HYGROMETER_SENSOR(body) => body.ser(version, bytes),
36472 Self::ILLUMINATOR_STATUS(body) => body.ser(version, bytes),
36473 Self::ISBD_LINK_STATUS(body) => body.ser(version, bytes),
36474 Self::LANDING_TARGET(body) => body.ser(version, bytes),
36475 Self::LINK_NODE_STATUS(body) => body.ser(version, bytes),
36476 Self::LOCAL_POSITION_NED(body) => body.ser(version, bytes),
36477 Self::LOCAL_POSITION_NED_COV(body) => body.ser(version, bytes),
36478 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(body) => body.ser(version, bytes),
36479 Self::LOGGING_ACK(body) => body.ser(version, bytes),
36480 Self::LOGGING_DATA(body) => body.ser(version, bytes),
36481 Self::LOGGING_DATA_ACKED(body) => body.ser(version, bytes),
36482 Self::LOG_DATA(body) => body.ser(version, bytes),
36483 Self::LOG_ENTRY(body) => body.ser(version, bytes),
36484 Self::LOG_ERASE(body) => body.ser(version, bytes),
36485 Self::LOG_REQUEST_DATA(body) => body.ser(version, bytes),
36486 Self::LOG_REQUEST_END(body) => body.ser(version, bytes),
36487 Self::LOG_REQUEST_LIST(body) => body.ser(version, bytes),
36488 Self::MAG_CAL_REPORT(body) => body.ser(version, bytes),
36489 Self::MANUAL_CONTROL(body) => body.ser(version, bytes),
36490 Self::MANUAL_SETPOINT(body) => body.ser(version, bytes),
36491 Self::MEMORY_VECT(body) => body.ser(version, bytes),
36492 Self::MESSAGE_INTERVAL(body) => body.ser(version, bytes),
36493 Self::MISSION_ACK(body) => body.ser(version, bytes),
36494 Self::MISSION_CLEAR_ALL(body) => body.ser(version, bytes),
36495 Self::MISSION_COUNT(body) => body.ser(version, bytes),
36496 Self::MISSION_CURRENT(body) => body.ser(version, bytes),
36497 Self::MISSION_ITEM(body) => body.ser(version, bytes),
36498 Self::MISSION_ITEM_INT(body) => body.ser(version, bytes),
36499 Self::MISSION_ITEM_REACHED(body) => body.ser(version, bytes),
36500 Self::MISSION_REQUEST(body) => body.ser(version, bytes),
36501 Self::MISSION_REQUEST_INT(body) => body.ser(version, bytes),
36502 Self::MISSION_REQUEST_LIST(body) => body.ser(version, bytes),
36503 Self::MISSION_REQUEST_PARTIAL_LIST(body) => body.ser(version, bytes),
36504 Self::MISSION_SET_CURRENT(body) => body.ser(version, bytes),
36505 Self::MISSION_WRITE_PARTIAL_LIST(body) => body.ser(version, bytes),
36506 Self::MOUNT_ORIENTATION(body) => body.ser(version, bytes),
36507 Self::NAMED_VALUE_FLOAT(body) => body.ser(version, bytes),
36508 Self::NAMED_VALUE_INT(body) => body.ser(version, bytes),
36509 Self::NAV_CONTROLLER_OUTPUT(body) => body.ser(version, bytes),
36510 Self::OBSTACLE_DISTANCE(body) => body.ser(version, bytes),
36511 Self::ODOMETRY(body) => body.ser(version, bytes),
36512 Self::ONBOARD_COMPUTER_STATUS(body) => body.ser(version, bytes),
36513 Self::OPEN_DRONE_ID_ARM_STATUS(body) => body.ser(version, bytes),
36514 Self::OPEN_DRONE_ID_AUTHENTICATION(body) => body.ser(version, bytes),
36515 Self::OPEN_DRONE_ID_BASIC_ID(body) => body.ser(version, bytes),
36516 Self::OPEN_DRONE_ID_LOCATION(body) => body.ser(version, bytes),
36517 Self::OPEN_DRONE_ID_MESSAGE_PACK(body) => body.ser(version, bytes),
36518 Self::OPEN_DRONE_ID_OPERATOR_ID(body) => body.ser(version, bytes),
36519 Self::OPEN_DRONE_ID_SELF_ID(body) => body.ser(version, bytes),
36520 Self::OPEN_DRONE_ID_SYSTEM(body) => body.ser(version, bytes),
36521 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(body) => body.ser(version, bytes),
36522 Self::OPTICAL_FLOW(body) => body.ser(version, bytes),
36523 Self::OPTICAL_FLOW_RAD(body) => body.ser(version, bytes),
36524 Self::ORBIT_EXECUTION_STATUS(body) => body.ser(version, bytes),
36525 Self::PARAM_EXT_ACK(body) => body.ser(version, bytes),
36526 Self::PARAM_EXT_REQUEST_LIST(body) => body.ser(version, bytes),
36527 Self::PARAM_EXT_REQUEST_READ(body) => body.ser(version, bytes),
36528 Self::PARAM_EXT_SET(body) => body.ser(version, bytes),
36529 Self::PARAM_EXT_VALUE(body) => body.ser(version, bytes),
36530 Self::PARAM_MAP_RC(body) => body.ser(version, bytes),
36531 Self::PARAM_REQUEST_LIST(body) => body.ser(version, bytes),
36532 Self::PARAM_REQUEST_READ(body) => body.ser(version, bytes),
36533 Self::PARAM_SET(body) => body.ser(version, bytes),
36534 Self::PARAM_VALUE(body) => body.ser(version, bytes),
36535 Self::PING(body) => body.ser(version, bytes),
36536 Self::PLAY_TUNE(body) => body.ser(version, bytes),
36537 Self::PLAY_TUNE_V2(body) => body.ser(version, bytes),
36538 Self::POSITION_TARGET_GLOBAL_INT(body) => body.ser(version, bytes),
36539 Self::POSITION_TARGET_LOCAL_NED(body) => body.ser(version, bytes),
36540 Self::POWER_STATUS(body) => body.ser(version, bytes),
36541 Self::PROTOCOL_VERSION(body) => body.ser(version, bytes),
36542 Self::RADIO_STATUS(body) => body.ser(version, bytes),
36543 Self::RAW_IMU(body) => body.ser(version, bytes),
36544 Self::RAW_PRESSURE(body) => body.ser(version, bytes),
36545 Self::RAW_RPM(body) => body.ser(version, bytes),
36546 Self::RC_CHANNELS(body) => body.ser(version, bytes),
36547 Self::RC_CHANNELS_OVERRIDE(body) => body.ser(version, bytes),
36548 Self::RC_CHANNELS_RAW(body) => body.ser(version, bytes),
36549 Self::RC_CHANNELS_SCALED(body) => body.ser(version, bytes),
36550 Self::REQUEST_DATA_STREAM(body) => body.ser(version, bytes),
36551 Self::REQUEST_EVENT(body) => body.ser(version, bytes),
36552 Self::RESOURCE_REQUEST(body) => body.ser(version, bytes),
36553 Self::RESPONSE_EVENT_ERROR(body) => body.ser(version, bytes),
36554 Self::SAFETY_ALLOWED_AREA(body) => body.ser(version, bytes),
36555 Self::SAFETY_SET_ALLOWED_AREA(body) => body.ser(version, bytes),
36556 Self::SCALED_IMU(body) => body.ser(version, bytes),
36557 Self::SCALED_IMU2(body) => body.ser(version, bytes),
36558 Self::SCALED_IMU3(body) => body.ser(version, bytes),
36559 Self::SCALED_PRESSURE(body) => body.ser(version, bytes),
36560 Self::SCALED_PRESSURE2(body) => body.ser(version, bytes),
36561 Self::SCALED_PRESSURE3(body) => body.ser(version, bytes),
36562 Self::SERIAL_CONTROL(body) => body.ser(version, bytes),
36563 Self::SERVO_OUTPUT_RAW(body) => body.ser(version, bytes),
36564 Self::SETUP_SIGNING(body) => body.ser(version, bytes),
36565 Self::SET_ACTUATOR_CONTROL_TARGET(body) => body.ser(version, bytes),
36566 Self::SET_ATTITUDE_TARGET(body) => body.ser(version, bytes),
36567 Self::SET_GPS_GLOBAL_ORIGIN(body) => body.ser(version, bytes),
36568 Self::SET_HOME_POSITION(body) => body.ser(version, bytes),
36569 Self::SET_MODE(body) => body.ser(version, bytes),
36570 Self::SET_POSITION_TARGET_GLOBAL_INT(body) => body.ser(version, bytes),
36571 Self::SET_POSITION_TARGET_LOCAL_NED(body) => body.ser(version, bytes),
36572 Self::SIM_STATE(body) => body.ser(version, bytes),
36573 Self::SMART_BATTERY_INFO(body) => body.ser(version, bytes),
36574 Self::STATUSTEXT(body) => body.ser(version, bytes),
36575 Self::STORAGE_INFORMATION(body) => body.ser(version, bytes),
36576 Self::SUPPORTED_TUNES(body) => body.ser(version, bytes),
36577 Self::SYSTEM_TIME(body) => body.ser(version, bytes),
36578 Self::SYS_STATUS(body) => body.ser(version, bytes),
36579 Self::TERRAIN_CHECK(body) => body.ser(version, bytes),
36580 Self::TERRAIN_DATA(body) => body.ser(version, bytes),
36581 Self::TERRAIN_REPORT(body) => body.ser(version, bytes),
36582 Self::TERRAIN_REQUEST(body) => body.ser(version, bytes),
36583 Self::TIMESYNC(body) => body.ser(version, bytes),
36584 Self::TIME_ESTIMATE_TO_TARGET(body) => body.ser(version, bytes),
36585 Self::TRAJECTORY_REPRESENTATION_BEZIER(body) => body.ser(version, bytes),
36586 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(body) => body.ser(version, bytes),
36587 Self::TUNNEL(body) => body.ser(version, bytes),
36588 Self::UAVCAN_NODE_INFO(body) => body.ser(version, bytes),
36589 Self::UAVCAN_NODE_STATUS(body) => body.ser(version, bytes),
36590 Self::UTM_GLOBAL_POSITION(body) => body.ser(version, bytes),
36591 Self::V2_EXTENSION(body) => body.ser(version, bytes),
36592 Self::VFR_HUD(body) => body.ser(version, bytes),
36593 Self::VIBRATION(body) => body.ser(version, bytes),
36594 Self::VICON_POSITION_ESTIMATE(body) => body.ser(version, bytes),
36595 Self::VIDEO_STREAM_INFORMATION(body) => body.ser(version, bytes),
36596 Self::VIDEO_STREAM_STATUS(body) => body.ser(version, bytes),
36597 Self::VISION_POSITION_ESTIMATE(body) => body.ser(version, bytes),
36598 Self::VISION_SPEED_ESTIMATE(body) => body.ser(version, bytes),
36599 Self::WHEEL_DISTANCE(body) => body.ser(version, bytes),
36600 Self::WIFI_CONFIG_AP(body) => body.ser(version, bytes),
36601 Self::WINCH_STATUS(body) => body.ser(version, bytes),
36602 Self::WIND_COV(body) => body.ser(version, bytes),
36603 }
36604 }
36605 fn extra_crc(id: u32) -> u8 {
36606 match id {
36607 ACTUATOR_CONTROL_TARGET_DATA::ID => ACTUATOR_CONTROL_TARGET_DATA::EXTRA_CRC,
36608 ACTUATOR_OUTPUT_STATUS_DATA::ID => ACTUATOR_OUTPUT_STATUS_DATA::EXTRA_CRC,
36609 ADSB_VEHICLE_DATA::ID => ADSB_VEHICLE_DATA::EXTRA_CRC,
36610 AIS_VESSEL_DATA::ID => AIS_VESSEL_DATA::EXTRA_CRC,
36611 ALTITUDE_DATA::ID => ALTITUDE_DATA::EXTRA_CRC,
36612 ATTITUDE_DATA::ID => ATTITUDE_DATA::EXTRA_CRC,
36613 ATTITUDE_QUATERNION_DATA::ID => ATTITUDE_QUATERNION_DATA::EXTRA_CRC,
36614 ATTITUDE_QUATERNION_COV_DATA::ID => ATTITUDE_QUATERNION_COV_DATA::EXTRA_CRC,
36615 ATTITUDE_TARGET_DATA::ID => ATTITUDE_TARGET_DATA::EXTRA_CRC,
36616 ATT_POS_MOCAP_DATA::ID => ATT_POS_MOCAP_DATA::EXTRA_CRC,
36617 AUTH_KEY_DATA::ID => AUTH_KEY_DATA::EXTRA_CRC,
36618 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
36619 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::EXTRA_CRC
36620 }
36621 AUTOPILOT_VERSION_DATA::ID => AUTOPILOT_VERSION_DATA::EXTRA_CRC,
36622 AVAILABLE_MODES_DATA::ID => AVAILABLE_MODES_DATA::EXTRA_CRC,
36623 AVAILABLE_MODES_MONITOR_DATA::ID => AVAILABLE_MODES_MONITOR_DATA::EXTRA_CRC,
36624 AVSS_DRONE_IMU_DATA::ID => AVSS_DRONE_IMU_DATA::EXTRA_CRC,
36625 AVSS_DRONE_OPERATION_MODE_DATA::ID => AVSS_DRONE_OPERATION_MODE_DATA::EXTRA_CRC,
36626 AVSS_DRONE_POSITION_DATA::ID => AVSS_DRONE_POSITION_DATA::EXTRA_CRC,
36627 AVSS_PRS_SYS_STATUS_DATA::ID => AVSS_PRS_SYS_STATUS_DATA::EXTRA_CRC,
36628 BATTERY_INFO_DATA::ID => BATTERY_INFO_DATA::EXTRA_CRC,
36629 BATTERY_STATUS_DATA::ID => BATTERY_STATUS_DATA::EXTRA_CRC,
36630 BUTTON_CHANGE_DATA::ID => BUTTON_CHANGE_DATA::EXTRA_CRC,
36631 CAMERA_CAPTURE_STATUS_DATA::ID => CAMERA_CAPTURE_STATUS_DATA::EXTRA_CRC,
36632 CAMERA_FOV_STATUS_DATA::ID => CAMERA_FOV_STATUS_DATA::EXTRA_CRC,
36633 CAMERA_IMAGE_CAPTURED_DATA::ID => CAMERA_IMAGE_CAPTURED_DATA::EXTRA_CRC,
36634 CAMERA_INFORMATION_DATA::ID => CAMERA_INFORMATION_DATA::EXTRA_CRC,
36635 CAMERA_SETTINGS_DATA::ID => CAMERA_SETTINGS_DATA::EXTRA_CRC,
36636 CAMERA_THERMAL_RANGE_DATA::ID => CAMERA_THERMAL_RANGE_DATA::EXTRA_CRC,
36637 CAMERA_TRACKING_GEO_STATUS_DATA::ID => CAMERA_TRACKING_GEO_STATUS_DATA::EXTRA_CRC,
36638 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => CAMERA_TRACKING_IMAGE_STATUS_DATA::EXTRA_CRC,
36639 CAMERA_TRIGGER_DATA::ID => CAMERA_TRIGGER_DATA::EXTRA_CRC,
36640 CANFD_FRAME_DATA::ID => CANFD_FRAME_DATA::EXTRA_CRC,
36641 CAN_FILTER_MODIFY_DATA::ID => CAN_FILTER_MODIFY_DATA::EXTRA_CRC,
36642 CAN_FRAME_DATA::ID => CAN_FRAME_DATA::EXTRA_CRC,
36643 CELLULAR_CONFIG_DATA::ID => CELLULAR_CONFIG_DATA::EXTRA_CRC,
36644 CELLULAR_STATUS_DATA::ID => CELLULAR_STATUS_DATA::EXTRA_CRC,
36645 CHANGE_OPERATOR_CONTROL_DATA::ID => CHANGE_OPERATOR_CONTROL_DATA::EXTRA_CRC,
36646 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => CHANGE_OPERATOR_CONTROL_ACK_DATA::EXTRA_CRC,
36647 COLLISION_DATA::ID => COLLISION_DATA::EXTRA_CRC,
36648 COMMAND_ACK_DATA::ID => COMMAND_ACK_DATA::EXTRA_CRC,
36649 COMMAND_CANCEL_DATA::ID => COMMAND_CANCEL_DATA::EXTRA_CRC,
36650 COMMAND_INT_DATA::ID => COMMAND_INT_DATA::EXTRA_CRC,
36651 COMMAND_LONG_DATA::ID => COMMAND_LONG_DATA::EXTRA_CRC,
36652 COMPONENT_INFORMATION_DATA::ID => COMPONENT_INFORMATION_DATA::EXTRA_CRC,
36653 COMPONENT_INFORMATION_BASIC_DATA::ID => COMPONENT_INFORMATION_BASIC_DATA::EXTRA_CRC,
36654 COMPONENT_METADATA_DATA::ID => COMPONENT_METADATA_DATA::EXTRA_CRC,
36655 CONTROL_SYSTEM_STATE_DATA::ID => CONTROL_SYSTEM_STATE_DATA::EXTRA_CRC,
36656 CURRENT_EVENT_SEQUENCE_DATA::ID => CURRENT_EVENT_SEQUENCE_DATA::EXTRA_CRC,
36657 CURRENT_MODE_DATA::ID => CURRENT_MODE_DATA::EXTRA_CRC,
36658 DATA_STREAM_DATA::ID => DATA_STREAM_DATA::EXTRA_CRC,
36659 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => DATA_TRANSMISSION_HANDSHAKE_DATA::EXTRA_CRC,
36660 DEBUG_DATA::ID => DEBUG_DATA::EXTRA_CRC,
36661 DEBUG_FLOAT_ARRAY_DATA::ID => DEBUG_FLOAT_ARRAY_DATA::EXTRA_CRC,
36662 DEBUG_VECT_DATA::ID => DEBUG_VECT_DATA::EXTRA_CRC,
36663 DISTANCE_SENSOR_DATA::ID => DISTANCE_SENSOR_DATA::EXTRA_CRC,
36664 EFI_STATUS_DATA::ID => EFI_STATUS_DATA::EXTRA_CRC,
36665 ENCAPSULATED_DATA_DATA::ID => ENCAPSULATED_DATA_DATA::EXTRA_CRC,
36666 ESC_INFO_DATA::ID => ESC_INFO_DATA::EXTRA_CRC,
36667 ESC_STATUS_DATA::ID => ESC_STATUS_DATA::EXTRA_CRC,
36668 ESTIMATOR_STATUS_DATA::ID => ESTIMATOR_STATUS_DATA::EXTRA_CRC,
36669 EVENT_DATA::ID => EVENT_DATA::EXTRA_CRC,
36670 EXTENDED_SYS_STATE_DATA::ID => EXTENDED_SYS_STATE_DATA::EXTRA_CRC,
36671 FENCE_STATUS_DATA::ID => FENCE_STATUS_DATA::EXTRA_CRC,
36672 FILE_TRANSFER_PROTOCOL_DATA::ID => FILE_TRANSFER_PROTOCOL_DATA::EXTRA_CRC,
36673 FLIGHT_INFORMATION_DATA::ID => FLIGHT_INFORMATION_DATA::EXTRA_CRC,
36674 FOLLOW_TARGET_DATA::ID => FOLLOW_TARGET_DATA::EXTRA_CRC,
36675 FUEL_STATUS_DATA::ID => FUEL_STATUS_DATA::EXTRA_CRC,
36676 GENERATOR_STATUS_DATA::ID => GENERATOR_STATUS_DATA::EXTRA_CRC,
36677 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::EXTRA_CRC,
36678 GIMBAL_DEVICE_INFORMATION_DATA::ID => GIMBAL_DEVICE_INFORMATION_DATA::EXTRA_CRC,
36679 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => GIMBAL_DEVICE_SET_ATTITUDE_DATA::EXTRA_CRC,
36680 GIMBAL_MANAGER_INFORMATION_DATA::ID => GIMBAL_MANAGER_INFORMATION_DATA::EXTRA_CRC,
36681 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => GIMBAL_MANAGER_SET_ATTITUDE_DATA::EXTRA_CRC,
36682 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
36683 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::EXTRA_CRC
36684 }
36685 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => GIMBAL_MANAGER_SET_PITCHYAW_DATA::EXTRA_CRC,
36686 GIMBAL_MANAGER_STATUS_DATA::ID => GIMBAL_MANAGER_STATUS_DATA::EXTRA_CRC,
36687 GLOBAL_POSITION_INT_DATA::ID => GLOBAL_POSITION_INT_DATA::EXTRA_CRC,
36688 GLOBAL_POSITION_INT_COV_DATA::ID => GLOBAL_POSITION_INT_COV_DATA::EXTRA_CRC,
36689 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
36690 GLOBAL_VISION_POSITION_ESTIMATE_DATA::EXTRA_CRC
36691 }
36692 GPS2_RAW_DATA::ID => GPS2_RAW_DATA::EXTRA_CRC,
36693 GPS2_RTK_DATA::ID => GPS2_RTK_DATA::EXTRA_CRC,
36694 GPS_GLOBAL_ORIGIN_DATA::ID => GPS_GLOBAL_ORIGIN_DATA::EXTRA_CRC,
36695 GPS_INJECT_DATA_DATA::ID => GPS_INJECT_DATA_DATA::EXTRA_CRC,
36696 GPS_INPUT_DATA::ID => GPS_INPUT_DATA::EXTRA_CRC,
36697 GPS_RAW_INT_DATA::ID => GPS_RAW_INT_DATA::EXTRA_CRC,
36698 GPS_RTCM_DATA_DATA::ID => GPS_RTCM_DATA_DATA::EXTRA_CRC,
36699 GPS_RTK_DATA::ID => GPS_RTK_DATA::EXTRA_CRC,
36700 GPS_STATUS_DATA::ID => GPS_STATUS_DATA::EXTRA_CRC,
36701 HEARTBEAT_DATA::ID => HEARTBEAT_DATA::EXTRA_CRC,
36702 HIGHRES_IMU_DATA::ID => HIGHRES_IMU_DATA::EXTRA_CRC,
36703 HIGH_LATENCY_DATA::ID => HIGH_LATENCY_DATA::EXTRA_CRC,
36704 HIGH_LATENCY2_DATA::ID => HIGH_LATENCY2_DATA::EXTRA_CRC,
36705 HIL_ACTUATOR_CONTROLS_DATA::ID => HIL_ACTUATOR_CONTROLS_DATA::EXTRA_CRC,
36706 HIL_CONTROLS_DATA::ID => HIL_CONTROLS_DATA::EXTRA_CRC,
36707 HIL_GPS_DATA::ID => HIL_GPS_DATA::EXTRA_CRC,
36708 HIL_OPTICAL_FLOW_DATA::ID => HIL_OPTICAL_FLOW_DATA::EXTRA_CRC,
36709 HIL_RC_INPUTS_RAW_DATA::ID => HIL_RC_INPUTS_RAW_DATA::EXTRA_CRC,
36710 HIL_SENSOR_DATA::ID => HIL_SENSOR_DATA::EXTRA_CRC,
36711 HIL_STATE_DATA::ID => HIL_STATE_DATA::EXTRA_CRC,
36712 HIL_STATE_QUATERNION_DATA::ID => HIL_STATE_QUATERNION_DATA::EXTRA_CRC,
36713 HOME_POSITION_DATA::ID => HOME_POSITION_DATA::EXTRA_CRC,
36714 HYGROMETER_SENSOR_DATA::ID => HYGROMETER_SENSOR_DATA::EXTRA_CRC,
36715 ILLUMINATOR_STATUS_DATA::ID => ILLUMINATOR_STATUS_DATA::EXTRA_CRC,
36716 ISBD_LINK_STATUS_DATA::ID => ISBD_LINK_STATUS_DATA::EXTRA_CRC,
36717 LANDING_TARGET_DATA::ID => LANDING_TARGET_DATA::EXTRA_CRC,
36718 LINK_NODE_STATUS_DATA::ID => LINK_NODE_STATUS_DATA::EXTRA_CRC,
36719 LOCAL_POSITION_NED_DATA::ID => LOCAL_POSITION_NED_DATA::EXTRA_CRC,
36720 LOCAL_POSITION_NED_COV_DATA::ID => LOCAL_POSITION_NED_COV_DATA::EXTRA_CRC,
36721 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
36722 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::EXTRA_CRC
36723 }
36724 LOGGING_ACK_DATA::ID => LOGGING_ACK_DATA::EXTRA_CRC,
36725 LOGGING_DATA_DATA::ID => LOGGING_DATA_DATA::EXTRA_CRC,
36726 LOGGING_DATA_ACKED_DATA::ID => LOGGING_DATA_ACKED_DATA::EXTRA_CRC,
36727 LOG_DATA_DATA::ID => LOG_DATA_DATA::EXTRA_CRC,
36728 LOG_ENTRY_DATA::ID => LOG_ENTRY_DATA::EXTRA_CRC,
36729 LOG_ERASE_DATA::ID => LOG_ERASE_DATA::EXTRA_CRC,
36730 LOG_REQUEST_DATA_DATA::ID => LOG_REQUEST_DATA_DATA::EXTRA_CRC,
36731 LOG_REQUEST_END_DATA::ID => LOG_REQUEST_END_DATA::EXTRA_CRC,
36732 LOG_REQUEST_LIST_DATA::ID => LOG_REQUEST_LIST_DATA::EXTRA_CRC,
36733 MAG_CAL_REPORT_DATA::ID => MAG_CAL_REPORT_DATA::EXTRA_CRC,
36734 MANUAL_CONTROL_DATA::ID => MANUAL_CONTROL_DATA::EXTRA_CRC,
36735 MANUAL_SETPOINT_DATA::ID => MANUAL_SETPOINT_DATA::EXTRA_CRC,
36736 MEMORY_VECT_DATA::ID => MEMORY_VECT_DATA::EXTRA_CRC,
36737 MESSAGE_INTERVAL_DATA::ID => MESSAGE_INTERVAL_DATA::EXTRA_CRC,
36738 MISSION_ACK_DATA::ID => MISSION_ACK_DATA::EXTRA_CRC,
36739 MISSION_CLEAR_ALL_DATA::ID => MISSION_CLEAR_ALL_DATA::EXTRA_CRC,
36740 MISSION_COUNT_DATA::ID => MISSION_COUNT_DATA::EXTRA_CRC,
36741 MISSION_CURRENT_DATA::ID => MISSION_CURRENT_DATA::EXTRA_CRC,
36742 MISSION_ITEM_DATA::ID => MISSION_ITEM_DATA::EXTRA_CRC,
36743 MISSION_ITEM_INT_DATA::ID => MISSION_ITEM_INT_DATA::EXTRA_CRC,
36744 MISSION_ITEM_REACHED_DATA::ID => MISSION_ITEM_REACHED_DATA::EXTRA_CRC,
36745 MISSION_REQUEST_DATA::ID => MISSION_REQUEST_DATA::EXTRA_CRC,
36746 MISSION_REQUEST_INT_DATA::ID => MISSION_REQUEST_INT_DATA::EXTRA_CRC,
36747 MISSION_REQUEST_LIST_DATA::ID => MISSION_REQUEST_LIST_DATA::EXTRA_CRC,
36748 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => MISSION_REQUEST_PARTIAL_LIST_DATA::EXTRA_CRC,
36749 MISSION_SET_CURRENT_DATA::ID => MISSION_SET_CURRENT_DATA::EXTRA_CRC,
36750 MISSION_WRITE_PARTIAL_LIST_DATA::ID => MISSION_WRITE_PARTIAL_LIST_DATA::EXTRA_CRC,
36751 MOUNT_ORIENTATION_DATA::ID => MOUNT_ORIENTATION_DATA::EXTRA_CRC,
36752 NAMED_VALUE_FLOAT_DATA::ID => NAMED_VALUE_FLOAT_DATA::EXTRA_CRC,
36753 NAMED_VALUE_INT_DATA::ID => NAMED_VALUE_INT_DATA::EXTRA_CRC,
36754 NAV_CONTROLLER_OUTPUT_DATA::ID => NAV_CONTROLLER_OUTPUT_DATA::EXTRA_CRC,
36755 OBSTACLE_DISTANCE_DATA::ID => OBSTACLE_DISTANCE_DATA::EXTRA_CRC,
36756 ODOMETRY_DATA::ID => ODOMETRY_DATA::EXTRA_CRC,
36757 ONBOARD_COMPUTER_STATUS_DATA::ID => ONBOARD_COMPUTER_STATUS_DATA::EXTRA_CRC,
36758 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => OPEN_DRONE_ID_ARM_STATUS_DATA::EXTRA_CRC,
36759 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => OPEN_DRONE_ID_AUTHENTICATION_DATA::EXTRA_CRC,
36760 OPEN_DRONE_ID_BASIC_ID_DATA::ID => OPEN_DRONE_ID_BASIC_ID_DATA::EXTRA_CRC,
36761 OPEN_DRONE_ID_LOCATION_DATA::ID => OPEN_DRONE_ID_LOCATION_DATA::EXTRA_CRC,
36762 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => OPEN_DRONE_ID_MESSAGE_PACK_DATA::EXTRA_CRC,
36763 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => OPEN_DRONE_ID_OPERATOR_ID_DATA::EXTRA_CRC,
36764 OPEN_DRONE_ID_SELF_ID_DATA::ID => OPEN_DRONE_ID_SELF_ID_DATA::EXTRA_CRC,
36765 OPEN_DRONE_ID_SYSTEM_DATA::ID => OPEN_DRONE_ID_SYSTEM_DATA::EXTRA_CRC,
36766 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::EXTRA_CRC,
36767 OPTICAL_FLOW_DATA::ID => OPTICAL_FLOW_DATA::EXTRA_CRC,
36768 OPTICAL_FLOW_RAD_DATA::ID => OPTICAL_FLOW_RAD_DATA::EXTRA_CRC,
36769 ORBIT_EXECUTION_STATUS_DATA::ID => ORBIT_EXECUTION_STATUS_DATA::EXTRA_CRC,
36770 PARAM_EXT_ACK_DATA::ID => PARAM_EXT_ACK_DATA::EXTRA_CRC,
36771 PARAM_EXT_REQUEST_LIST_DATA::ID => PARAM_EXT_REQUEST_LIST_DATA::EXTRA_CRC,
36772 PARAM_EXT_REQUEST_READ_DATA::ID => PARAM_EXT_REQUEST_READ_DATA::EXTRA_CRC,
36773 PARAM_EXT_SET_DATA::ID => PARAM_EXT_SET_DATA::EXTRA_CRC,
36774 PARAM_EXT_VALUE_DATA::ID => PARAM_EXT_VALUE_DATA::EXTRA_CRC,
36775 PARAM_MAP_RC_DATA::ID => PARAM_MAP_RC_DATA::EXTRA_CRC,
36776 PARAM_REQUEST_LIST_DATA::ID => PARAM_REQUEST_LIST_DATA::EXTRA_CRC,
36777 PARAM_REQUEST_READ_DATA::ID => PARAM_REQUEST_READ_DATA::EXTRA_CRC,
36778 PARAM_SET_DATA::ID => PARAM_SET_DATA::EXTRA_CRC,
36779 PARAM_VALUE_DATA::ID => PARAM_VALUE_DATA::EXTRA_CRC,
36780 PING_DATA::ID => PING_DATA::EXTRA_CRC,
36781 PLAY_TUNE_DATA::ID => PLAY_TUNE_DATA::EXTRA_CRC,
36782 PLAY_TUNE_V2_DATA::ID => PLAY_TUNE_V2_DATA::EXTRA_CRC,
36783 POSITION_TARGET_GLOBAL_INT_DATA::ID => POSITION_TARGET_GLOBAL_INT_DATA::EXTRA_CRC,
36784 POSITION_TARGET_LOCAL_NED_DATA::ID => POSITION_TARGET_LOCAL_NED_DATA::EXTRA_CRC,
36785 POWER_STATUS_DATA::ID => POWER_STATUS_DATA::EXTRA_CRC,
36786 PROTOCOL_VERSION_DATA::ID => PROTOCOL_VERSION_DATA::EXTRA_CRC,
36787 RADIO_STATUS_DATA::ID => RADIO_STATUS_DATA::EXTRA_CRC,
36788 RAW_IMU_DATA::ID => RAW_IMU_DATA::EXTRA_CRC,
36789 RAW_PRESSURE_DATA::ID => RAW_PRESSURE_DATA::EXTRA_CRC,
36790 RAW_RPM_DATA::ID => RAW_RPM_DATA::EXTRA_CRC,
36791 RC_CHANNELS_DATA::ID => RC_CHANNELS_DATA::EXTRA_CRC,
36792 RC_CHANNELS_OVERRIDE_DATA::ID => RC_CHANNELS_OVERRIDE_DATA::EXTRA_CRC,
36793 RC_CHANNELS_RAW_DATA::ID => RC_CHANNELS_RAW_DATA::EXTRA_CRC,
36794 RC_CHANNELS_SCALED_DATA::ID => RC_CHANNELS_SCALED_DATA::EXTRA_CRC,
36795 REQUEST_DATA_STREAM_DATA::ID => REQUEST_DATA_STREAM_DATA::EXTRA_CRC,
36796 REQUEST_EVENT_DATA::ID => REQUEST_EVENT_DATA::EXTRA_CRC,
36797 RESOURCE_REQUEST_DATA::ID => RESOURCE_REQUEST_DATA::EXTRA_CRC,
36798 RESPONSE_EVENT_ERROR_DATA::ID => RESPONSE_EVENT_ERROR_DATA::EXTRA_CRC,
36799 SAFETY_ALLOWED_AREA_DATA::ID => SAFETY_ALLOWED_AREA_DATA::EXTRA_CRC,
36800 SAFETY_SET_ALLOWED_AREA_DATA::ID => SAFETY_SET_ALLOWED_AREA_DATA::EXTRA_CRC,
36801 SCALED_IMU_DATA::ID => SCALED_IMU_DATA::EXTRA_CRC,
36802 SCALED_IMU2_DATA::ID => SCALED_IMU2_DATA::EXTRA_CRC,
36803 SCALED_IMU3_DATA::ID => SCALED_IMU3_DATA::EXTRA_CRC,
36804 SCALED_PRESSURE_DATA::ID => SCALED_PRESSURE_DATA::EXTRA_CRC,
36805 SCALED_PRESSURE2_DATA::ID => SCALED_PRESSURE2_DATA::EXTRA_CRC,
36806 SCALED_PRESSURE3_DATA::ID => SCALED_PRESSURE3_DATA::EXTRA_CRC,
36807 SERIAL_CONTROL_DATA::ID => SERIAL_CONTROL_DATA::EXTRA_CRC,
36808 SERVO_OUTPUT_RAW_DATA::ID => SERVO_OUTPUT_RAW_DATA::EXTRA_CRC,
36809 SETUP_SIGNING_DATA::ID => SETUP_SIGNING_DATA::EXTRA_CRC,
36810 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => SET_ACTUATOR_CONTROL_TARGET_DATA::EXTRA_CRC,
36811 SET_ATTITUDE_TARGET_DATA::ID => SET_ATTITUDE_TARGET_DATA::EXTRA_CRC,
36812 SET_GPS_GLOBAL_ORIGIN_DATA::ID => SET_GPS_GLOBAL_ORIGIN_DATA::EXTRA_CRC,
36813 SET_HOME_POSITION_DATA::ID => SET_HOME_POSITION_DATA::EXTRA_CRC,
36814 SET_MODE_DATA::ID => SET_MODE_DATA::EXTRA_CRC,
36815 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => {
36816 SET_POSITION_TARGET_GLOBAL_INT_DATA::EXTRA_CRC
36817 }
36818 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => SET_POSITION_TARGET_LOCAL_NED_DATA::EXTRA_CRC,
36819 SIM_STATE_DATA::ID => SIM_STATE_DATA::EXTRA_CRC,
36820 SMART_BATTERY_INFO_DATA::ID => SMART_BATTERY_INFO_DATA::EXTRA_CRC,
36821 STATUSTEXT_DATA::ID => STATUSTEXT_DATA::EXTRA_CRC,
36822 STORAGE_INFORMATION_DATA::ID => STORAGE_INFORMATION_DATA::EXTRA_CRC,
36823 SUPPORTED_TUNES_DATA::ID => SUPPORTED_TUNES_DATA::EXTRA_CRC,
36824 SYSTEM_TIME_DATA::ID => SYSTEM_TIME_DATA::EXTRA_CRC,
36825 SYS_STATUS_DATA::ID => SYS_STATUS_DATA::EXTRA_CRC,
36826 TERRAIN_CHECK_DATA::ID => TERRAIN_CHECK_DATA::EXTRA_CRC,
36827 TERRAIN_DATA_DATA::ID => TERRAIN_DATA_DATA::EXTRA_CRC,
36828 TERRAIN_REPORT_DATA::ID => TERRAIN_REPORT_DATA::EXTRA_CRC,
36829 TERRAIN_REQUEST_DATA::ID => TERRAIN_REQUEST_DATA::EXTRA_CRC,
36830 TIMESYNC_DATA::ID => TIMESYNC_DATA::EXTRA_CRC,
36831 TIME_ESTIMATE_TO_TARGET_DATA::ID => TIME_ESTIMATE_TO_TARGET_DATA::EXTRA_CRC,
36832 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
36833 TRAJECTORY_REPRESENTATION_BEZIER_DATA::EXTRA_CRC
36834 }
36835 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
36836 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::EXTRA_CRC
36837 }
36838 TUNNEL_DATA::ID => TUNNEL_DATA::EXTRA_CRC,
36839 UAVCAN_NODE_INFO_DATA::ID => UAVCAN_NODE_INFO_DATA::EXTRA_CRC,
36840 UAVCAN_NODE_STATUS_DATA::ID => UAVCAN_NODE_STATUS_DATA::EXTRA_CRC,
36841 UTM_GLOBAL_POSITION_DATA::ID => UTM_GLOBAL_POSITION_DATA::EXTRA_CRC,
36842 V2_EXTENSION_DATA::ID => V2_EXTENSION_DATA::EXTRA_CRC,
36843 VFR_HUD_DATA::ID => VFR_HUD_DATA::EXTRA_CRC,
36844 VIBRATION_DATA::ID => VIBRATION_DATA::EXTRA_CRC,
36845 VICON_POSITION_ESTIMATE_DATA::ID => VICON_POSITION_ESTIMATE_DATA::EXTRA_CRC,
36846 VIDEO_STREAM_INFORMATION_DATA::ID => VIDEO_STREAM_INFORMATION_DATA::EXTRA_CRC,
36847 VIDEO_STREAM_STATUS_DATA::ID => VIDEO_STREAM_STATUS_DATA::EXTRA_CRC,
36848 VISION_POSITION_ESTIMATE_DATA::ID => VISION_POSITION_ESTIMATE_DATA::EXTRA_CRC,
36849 VISION_SPEED_ESTIMATE_DATA::ID => VISION_SPEED_ESTIMATE_DATA::EXTRA_CRC,
36850 WHEEL_DISTANCE_DATA::ID => WHEEL_DISTANCE_DATA::EXTRA_CRC,
36851 WIFI_CONFIG_AP_DATA::ID => WIFI_CONFIG_AP_DATA::EXTRA_CRC,
36852 WINCH_STATUS_DATA::ID => WINCH_STATUS_DATA::EXTRA_CRC,
36853 WIND_COV_DATA::ID => WIND_COV_DATA::EXTRA_CRC,
36854 _ => 0,
36855 }
36856 }
36857 fn target_system_id(&self) -> Option<u8> {
36858 match self {
36859 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(inner) => Some(inner.target_system),
36860 Self::CANFD_FRAME(inner) => Some(inner.target_system),
36861 Self::CAN_FILTER_MODIFY(inner) => Some(inner.target_system),
36862 Self::CAN_FRAME(inner) => Some(inner.target_system),
36863 Self::CHANGE_OPERATOR_CONTROL(inner) => Some(inner.target_system),
36864 Self::COMMAND_ACK(inner) => Some(inner.target_system),
36865 Self::COMMAND_CANCEL(inner) => Some(inner.target_system),
36866 Self::COMMAND_INT(inner) => Some(inner.target_system),
36867 Self::COMMAND_LONG(inner) => Some(inner.target_system),
36868 Self::FILE_TRANSFER_PROTOCOL(inner) => Some(inner.target_system),
36869 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(inner) => Some(inner.target_system),
36870 Self::GIMBAL_DEVICE_SET_ATTITUDE(inner) => Some(inner.target_system),
36871 Self::GIMBAL_MANAGER_SET_ATTITUDE(inner) => Some(inner.target_system),
36872 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(inner) => Some(inner.target_system),
36873 Self::GIMBAL_MANAGER_SET_PITCHYAW(inner) => Some(inner.target_system),
36874 Self::GPS_INJECT_DATA(inner) => Some(inner.target_system),
36875 Self::LOGGING_ACK(inner) => Some(inner.target_system),
36876 Self::LOGGING_DATA(inner) => Some(inner.target_system),
36877 Self::LOGGING_DATA_ACKED(inner) => Some(inner.target_system),
36878 Self::LOG_ERASE(inner) => Some(inner.target_system),
36879 Self::LOG_REQUEST_DATA(inner) => Some(inner.target_system),
36880 Self::LOG_REQUEST_END(inner) => Some(inner.target_system),
36881 Self::LOG_REQUEST_LIST(inner) => Some(inner.target_system),
36882 Self::MISSION_ACK(inner) => Some(inner.target_system),
36883 Self::MISSION_CLEAR_ALL(inner) => Some(inner.target_system),
36884 Self::MISSION_COUNT(inner) => Some(inner.target_system),
36885 Self::MISSION_ITEM(inner) => Some(inner.target_system),
36886 Self::MISSION_ITEM_INT(inner) => Some(inner.target_system),
36887 Self::MISSION_REQUEST(inner) => Some(inner.target_system),
36888 Self::MISSION_REQUEST_INT(inner) => Some(inner.target_system),
36889 Self::MISSION_REQUEST_LIST(inner) => Some(inner.target_system),
36890 Self::MISSION_REQUEST_PARTIAL_LIST(inner) => Some(inner.target_system),
36891 Self::MISSION_SET_CURRENT(inner) => Some(inner.target_system),
36892 Self::MISSION_WRITE_PARTIAL_LIST(inner) => Some(inner.target_system),
36893 Self::OPEN_DRONE_ID_AUTHENTICATION(inner) => Some(inner.target_system),
36894 Self::OPEN_DRONE_ID_BASIC_ID(inner) => Some(inner.target_system),
36895 Self::OPEN_DRONE_ID_LOCATION(inner) => Some(inner.target_system),
36896 Self::OPEN_DRONE_ID_MESSAGE_PACK(inner) => Some(inner.target_system),
36897 Self::OPEN_DRONE_ID_OPERATOR_ID(inner) => Some(inner.target_system),
36898 Self::OPEN_DRONE_ID_SELF_ID(inner) => Some(inner.target_system),
36899 Self::OPEN_DRONE_ID_SYSTEM(inner) => Some(inner.target_system),
36900 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(inner) => Some(inner.target_system),
36901 Self::PARAM_EXT_REQUEST_LIST(inner) => Some(inner.target_system),
36902 Self::PARAM_EXT_REQUEST_READ(inner) => Some(inner.target_system),
36903 Self::PARAM_EXT_SET(inner) => Some(inner.target_system),
36904 Self::PARAM_MAP_RC(inner) => Some(inner.target_system),
36905 Self::PARAM_REQUEST_LIST(inner) => Some(inner.target_system),
36906 Self::PARAM_REQUEST_READ(inner) => Some(inner.target_system),
36907 Self::PARAM_SET(inner) => Some(inner.target_system),
36908 Self::PING(inner) => Some(inner.target_system),
36909 Self::PLAY_TUNE(inner) => Some(inner.target_system),
36910 Self::PLAY_TUNE_V2(inner) => Some(inner.target_system),
36911 Self::RC_CHANNELS_OVERRIDE(inner) => Some(inner.target_system),
36912 Self::REQUEST_DATA_STREAM(inner) => Some(inner.target_system),
36913 Self::REQUEST_EVENT(inner) => Some(inner.target_system),
36914 Self::RESPONSE_EVENT_ERROR(inner) => Some(inner.target_system),
36915 Self::SAFETY_SET_ALLOWED_AREA(inner) => Some(inner.target_system),
36916 Self::SERIAL_CONTROL(inner) => Some(inner.target_system),
36917 Self::SETUP_SIGNING(inner) => Some(inner.target_system),
36918 Self::SET_ACTUATOR_CONTROL_TARGET(inner) => Some(inner.target_system),
36919 Self::SET_ATTITUDE_TARGET(inner) => Some(inner.target_system),
36920 Self::SET_GPS_GLOBAL_ORIGIN(inner) => Some(inner.target_system),
36921 Self::SET_HOME_POSITION(inner) => Some(inner.target_system),
36922 Self::SET_MODE(inner) => Some(inner.target_system),
36923 Self::SET_POSITION_TARGET_GLOBAL_INT(inner) => Some(inner.target_system),
36924 Self::SET_POSITION_TARGET_LOCAL_NED(inner) => Some(inner.target_system),
36925 Self::SUPPORTED_TUNES(inner) => Some(inner.target_system),
36926 Self::TIMESYNC(inner) => Some(inner.target_system),
36927 Self::TUNNEL(inner) => Some(inner.target_system),
36928 Self::V2_EXTENSION(inner) => Some(inner.target_system),
36929 _ => None,
36930 }
36931 }
36932 fn target_component_id(&self) -> Option<u8> {
36933 match self {
36934 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(inner) => Some(inner.target_component),
36935 Self::CANFD_FRAME(inner) => Some(inner.target_component),
36936 Self::CAN_FILTER_MODIFY(inner) => Some(inner.target_component),
36937 Self::CAN_FRAME(inner) => Some(inner.target_component),
36938 Self::COMMAND_ACK(inner) => Some(inner.target_component),
36939 Self::COMMAND_CANCEL(inner) => Some(inner.target_component),
36940 Self::COMMAND_INT(inner) => Some(inner.target_component),
36941 Self::COMMAND_LONG(inner) => Some(inner.target_component),
36942 Self::FILE_TRANSFER_PROTOCOL(inner) => Some(inner.target_component),
36943 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(inner) => Some(inner.target_component),
36944 Self::GIMBAL_DEVICE_SET_ATTITUDE(inner) => Some(inner.target_component),
36945 Self::GIMBAL_MANAGER_SET_ATTITUDE(inner) => Some(inner.target_component),
36946 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(inner) => Some(inner.target_component),
36947 Self::GIMBAL_MANAGER_SET_PITCHYAW(inner) => Some(inner.target_component),
36948 Self::GPS_INJECT_DATA(inner) => Some(inner.target_component),
36949 Self::LOGGING_ACK(inner) => Some(inner.target_component),
36950 Self::LOGGING_DATA(inner) => Some(inner.target_component),
36951 Self::LOGGING_DATA_ACKED(inner) => Some(inner.target_component),
36952 Self::LOG_ERASE(inner) => Some(inner.target_component),
36953 Self::LOG_REQUEST_DATA(inner) => Some(inner.target_component),
36954 Self::LOG_REQUEST_END(inner) => Some(inner.target_component),
36955 Self::LOG_REQUEST_LIST(inner) => Some(inner.target_component),
36956 Self::MISSION_ACK(inner) => Some(inner.target_component),
36957 Self::MISSION_CLEAR_ALL(inner) => Some(inner.target_component),
36958 Self::MISSION_COUNT(inner) => Some(inner.target_component),
36959 Self::MISSION_ITEM(inner) => Some(inner.target_component),
36960 Self::MISSION_ITEM_INT(inner) => Some(inner.target_component),
36961 Self::MISSION_REQUEST(inner) => Some(inner.target_component),
36962 Self::MISSION_REQUEST_INT(inner) => Some(inner.target_component),
36963 Self::MISSION_REQUEST_LIST(inner) => Some(inner.target_component),
36964 Self::MISSION_REQUEST_PARTIAL_LIST(inner) => Some(inner.target_component),
36965 Self::MISSION_SET_CURRENT(inner) => Some(inner.target_component),
36966 Self::MISSION_WRITE_PARTIAL_LIST(inner) => Some(inner.target_component),
36967 Self::OPEN_DRONE_ID_AUTHENTICATION(inner) => Some(inner.target_component),
36968 Self::OPEN_DRONE_ID_BASIC_ID(inner) => Some(inner.target_component),
36969 Self::OPEN_DRONE_ID_LOCATION(inner) => Some(inner.target_component),
36970 Self::OPEN_DRONE_ID_MESSAGE_PACK(inner) => Some(inner.target_component),
36971 Self::OPEN_DRONE_ID_OPERATOR_ID(inner) => Some(inner.target_component),
36972 Self::OPEN_DRONE_ID_SELF_ID(inner) => Some(inner.target_component),
36973 Self::OPEN_DRONE_ID_SYSTEM(inner) => Some(inner.target_component),
36974 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(inner) => Some(inner.target_component),
36975 Self::PARAM_EXT_REQUEST_LIST(inner) => Some(inner.target_component),
36976 Self::PARAM_EXT_REQUEST_READ(inner) => Some(inner.target_component),
36977 Self::PARAM_EXT_SET(inner) => Some(inner.target_component),
36978 Self::PARAM_MAP_RC(inner) => Some(inner.target_component),
36979 Self::PARAM_REQUEST_LIST(inner) => Some(inner.target_component),
36980 Self::PARAM_REQUEST_READ(inner) => Some(inner.target_component),
36981 Self::PARAM_SET(inner) => Some(inner.target_component),
36982 Self::PING(inner) => Some(inner.target_component),
36983 Self::PLAY_TUNE(inner) => Some(inner.target_component),
36984 Self::PLAY_TUNE_V2(inner) => Some(inner.target_component),
36985 Self::RC_CHANNELS_OVERRIDE(inner) => Some(inner.target_component),
36986 Self::REQUEST_DATA_STREAM(inner) => Some(inner.target_component),
36987 Self::REQUEST_EVENT(inner) => Some(inner.target_component),
36988 Self::RESPONSE_EVENT_ERROR(inner) => Some(inner.target_component),
36989 Self::SAFETY_SET_ALLOWED_AREA(inner) => Some(inner.target_component),
36990 Self::SERIAL_CONTROL(inner) => Some(inner.target_component),
36991 Self::SETUP_SIGNING(inner) => Some(inner.target_component),
36992 Self::SET_ACTUATOR_CONTROL_TARGET(inner) => Some(inner.target_component),
36993 Self::SET_ATTITUDE_TARGET(inner) => Some(inner.target_component),
36994 Self::SET_POSITION_TARGET_GLOBAL_INT(inner) => Some(inner.target_component),
36995 Self::SET_POSITION_TARGET_LOCAL_NED(inner) => Some(inner.target_component),
36996 Self::SUPPORTED_TUNES(inner) => Some(inner.target_component),
36997 Self::TIMESYNC(inner) => Some(inner.target_component),
36998 Self::TUNNEL(inner) => Some(inner.target_component),
36999 Self::V2_EXTENSION(inner) => Some(inner.target_component),
37000 _ => None,
37001 }
37002 }
37003}